method IWebSocketService.routeUpgrade
Since 0.3.0
IWebSocketService.routeUpgrade(
request: Request,
principal?: IPrincipal
): Promise<WebSocketUpgradeDecision | null>

Consults the internal upgrade router for an inbound request. Used by the kernel terminal handler to decide whether to upgrade after the middleware pipeline runs.

Parameters

request: Request

The native, undisturbed upgrade request

optional
principal: IPrincipal

The authenticated principal, when the middleware pipeline produced one (ctx.request.user). Absent when the upgrade was not authenticated; implementations must treat a missing principal as anonymous and must not throw on its absence.

Return Type

Promise<WebSocketUpgradeDecision | null>

The decision, or null to fall through

Usage

import { type IWebSocketService } from "common/src/index.ts";