Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Deno.upgradeHttp

UNSTABLE: new API, yet to be vetter.

Allows to "hijack" a connection that the request is associated with. Can be used to implement protocols that build on top of HTTP (eg. WebSockets).

The returned promise returns underlying connection and first packet received. The promise shouldn't be awaited before responding to the request, otherwise event loop might deadlock.

function upgradeHttp(request: Request): Promise<[Deno.Conn, Uint8Array]>;
§
upgradeHttp(request: Request): Promise<[Deno.Conn, Uint8Array]>
[src]

§Parameters

§
request: Request
[src]

§Return Type

§
Promise<[Deno.Conn, Uint8Array]>
[src]