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

x/oak/request.ts>Request#upgrade

A middleware framework for handling HTTP with Deno, Node, Bun and Cloudflare Workers 🐿️ 🦕
Very Popular
Go to Latest
method Request.prototype.upgrade
import { Request } from "https://deno.land/x/oak@v17.0.0/request.ts";

Take the current request and upgrade it to a web socket, returning a web standard WebSocket object.

If the underlying server abstraction does not support upgrades, this will throw.

![WARNING] This is not intended for direct use, as it will not manage the websocket in the overall context or ensure that additional middleware does not attempt to respond to the request.