WebhookServer class abstract
This is the Dart analogue of the Python WebhookServer.
It does not own the HttpServer – instead, you:
- construct it with a
pathand optionalwebhookSecret - call
handleHttpRequest(request)from your shared server (e.g. ServiceHost) and it will: - validate the signature (if enabled)
- detect WebSocket upgrade vs POST/JSON
- route events to
onRoomStarted,onRoomEnded,onCall,onCallAnswered.
- Implementers
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- host → String
-
final
- path → String
-
final
- port → int
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- supportsWebSockets → bool
-
final
- validateWebhookSecret → bool
-
final
- webhookSecret → String?
-
final
Methods
-
handleHttpRequest(
HttpRequest request) → Future< bool> -
Main entry point to handle an incoming HTTP request.
Returns
trueif this server handled the request,falseotherwise. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onCall(
CallEvent event) → Future< void> - Override in subclasses as needed.
-
onCallAnswered(
RoomClient room) → Future< void> - Override in subclasses as needed.
-
onRoomEnded(
RoomEndedEvent event) → Future< void> - Override in subclasses as needed.
-
onRoomStarted(
RoomStartedEvent event) → Future< void> - Override in subclasses as needed.
-
onWebhook(
{required Map< String, dynamic> payload}) → Future<void> -
start(
) → Future< void> - No-op by default – in a “shared app” scenario the outer host controls the actual HttpServer.
-
stop(
) → Future< void> - No-op by default.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited