import { WebSocketServer } from "https://deno.land/x/ayonli_jsext@v0.9.72/ws.ts";
Upgrades the request to a WebSocket connection in Deno, Bun and Cloudflare Workers.
This function can also be used in Node.js if the HTTP request listener is
created using the withWeb
function from @ayonli/jsext/http
module.
NOTE: This function fails if the request is not a WebSocket upgrade request.
Parameters
request: Request
Returns
{ socket: WebSocketConnection; response: Response; }
Upgrades the request to a WebSocket connection in Node.js.
NOTE: This function fails if the request is not a WebSocket upgrade request.
Parameters
request: IncomingMessage
Returns
{ socket: WebSocketConnection; }