Skip to main content
Module

x/cav/http.ts>upgradeWebSocket

A server framework for Deno
Go to Latest
function upgradeWebSocket
import { upgradeWebSocket } from "https://deno.land/x/cav@0.0.21/http.ts";

The server-side equivalent of the wrapWebSocket function in the client module. Returns the Socket instance and a Response which should be returned by the handler for the socket upgrade to complete successfully.

Type Parameters

optional
Send = unknown
optional
Message extends Parser | null = null

Returns

{ socket: Socket<Send, (Message extends Parser ? ParserOutput<Message> : unknown)>; response: Response; }