method WsServerLike.handleUpgrade
WsServerLike.handleUpgrade(
request: unknown,
socket: unknown,
head: unknown,
callback: (ws: WsSocketLike) => void
): void

Completes the handshake over an already-accepted TCP connection.

Parameters

request: unknown

The Node IncomingMessage from the upgrade event

socket: unknown

The raw duplex socket from the upgrade event

head: unknown

The bytes the HTTP parser already buffered

callback: (ws: WsSocketLike) => void

Receives the completed socket

Return Type

void

Usage

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