WebhookServer class abstract

This is the Dart analogue of the Python WebhookServer.

It does not own the HttpServer – instead, you:

  • construct it with a path and optional webhookSecret
  • 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

WebhookServer({String? host, int? port, String? path, bool? validateWebhookSecret, String? webhookSecret, bool supportsWebSockets = true})

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 true if this server handled the request, false otherwise.
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