function createUpgradeRequest
Since 0.2.0
createUpgradeRequest(incoming: NodeIncomingMessage): Request

Reconstructs a web-standard Request from Node's upgrade event arguments, so the upgrade router sees the same shape on every runtime.

An upgrade request never carries a body, so none is attached — which also keeps the request undisturbed for the handshake.

Parameters

The Node request from the upgrade event

Return Type

The equivalent web-standard request

Usage

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