method DenoServeHost.upgradeWebSocket
DenoServeHost.upgradeWebSocket(
request: Request,
options?: { protocol?: string; }
): DenoWebSocketUpgrade

Performs an RFC 6455 handshake on an inbound request.

Optional so that a host injected before this seam existed still satisfies the interface; when absent, the adapter refuses upgrades with 501.

Parameters

request: Request

The native, undisturbed upgrade request

optional
options: { protocol?: string; }

Handshake options; protocol echoes a negotiated subprotocol

Return Type

The server-side socket and the 101 response to return

Usage

import { type DenoServeHost } from "runtime/src/index.ts";