method CloudflareWebSocketHost.createUpgradeResponse
CloudflareWebSocketHost.createUpgradeResponse(
client: unknown,
protocol?: string
): Response

Builds the 101 response that hands the client half back to the peer.

Parameters

client: unknown

The client half of the pair

optional
protocol: string

The negotiated subprotocol to echo, when one was selected

Return Type

The 101 response

Usage

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