Skip to content

WebSocketFallbackOptions

Defined in: relay-sdks/ts/packages/relay-websocket/src/fallback.ts:16

Options for withWebSocketFallback.

onFallback?: (reason) => void;

Defined in: relay-sdks/ts/packages/relay-websocket/src/fallback.ts:29

Called once when a connection ends up on WebSocket, with why WebTransport was not used: its handshake failed, the WebSocket was ready first (both an error), or the runtime has no usable WebTransport (undefined). For logging; it cannot change the outcome.

Parameter Type
reason unknown

void


webSocketDelayMs?: number;

Defined in: relay-sdks/ts/packages/relay-websocket/src/fallback.ts:23

The WebTransport dial’s head start, in milliseconds: if its handshake has not completed by then, the WebSocket dial starts too and the first to be ready carries the session. Default 250, the Connection Attempt Delay of Happy Eyeballs (RFC 8305). 0 starts both dials at once. A WebTransport handshake that fails sooner starts the WebSocket dial straight away.