Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/cli/tsc/dts/lib.deno.unstable.d.ts>Deno.upgradeHttpRaw

A modern runtime for JavaScript and TypeScript.
Go to Latest
function Deno.upgradeHttpRaw
import { Deno } from "https://deno.land/x/deno@v1.28.3/cli/tsc/dts/lib.deno.unstable.d.ts";
const { upgradeHttpRaw } = Deno;

UNSTABLE: New API, yet to be vetted.

Allows "hijacking" the connection that the request is associated with. This can be used to implement protocols that build on top of HTTP (eg. WebSocket).

Unlike Deno.upgradeHttp this function does not require that you respond to the request with a Response object. Instead this function returns the underlying connection and first packet received immediately, and then the caller is responsible for writing the response to the connection.

This method can only be called on requests originating the Deno.serve server.

Returns

[Deno.Conn, Uint8Array]