import { Context } from "https://deno.land/x/acorn@0.7.1/context.ts";
Attempt to upgrade the request to a web socket, returning the socket and the response to be returned.
Example
import { Router } from "https://deno.land/x/acorn/mod.ts";
const router = new Router();
router.get("/ws", (ctx) => {
const { socket, response } = ctx.upgrade();
// Perform actions with the socket.
return response;
});
router.listen({ port: 8000 });
Parameters
optional
options: UpgradeWebSocketOptions