Aller au contenu
Français

WebsocketRouteRegistration

Ce contenu n’est pas encore disponible dans votre langue.

WebsocketRouteRegistration = object

Defined in: src/http/backend/HttpServerBackend.ts:21

One WebSocket route registration. The backend accepts the HTTP upgrade at pattern (a GET), MUST call authorize first (a non-null result means: send that plain HTTP response and DO NOT upgrade), and then call onConnection exactly once — synchronously inside its native open/upgrade callback — handing over a normalised socket. Everything actor-related lives behind onConnection; the backend never sees the framework’s actors.

readonly authorize: (request) => Promise<HttpResponse | null>

Defined in: src/http/backend/HttpServerBackend.ts:25

Pre-upgrade guard. null → proceed; HttpResponse → reject with it.

HttpRequest

Promise<HttpResponse | null>


readonly onConnection: (request, socket) => void

Defined in: src/http/backend/HttpServerBackend.ts:27

Called once per accepted connection, synchronously in the upgrade callback.

HttpRequest

WebsocketSocketAdapter

void


readonly pattern: string

Defined in: src/http/backend/HttpServerBackend.ts:23

':param'-style pattern, same dialect as RouteRegistration.pattern.