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

x/ayonli_jsext/workerd/ws.ts>WebSocketServer

A JavaScript extension package for building strong and modern applications.
Latest
class WebSocketServer
import { WebSocketServer } from "https://deno.land/x/ayonli_jsext@v0.9.72/workerd/ws.ts";

Constructors

new
WebSocketServer(handler?: WebSocketHandler | undefined)
new
WebSocketServer(options: ServerOptions, handler: WebSocketHandler)
new
WebSocketServer(...args: any[])

Properties

protected
idleTimeout: number
protected
perMessageDeflate: boolean
protected
[_clients]: Map<Request, WebSocketConnection>
protected
[_handler]: WebSocketHandler | undefined
readonly
bunListener: { idleTimeout: number; perMessageDeflate: boolean; message: (ws: any, message: string | ArrayBuffer | Uint8Array) => void; open: (ws: any) => void; error: (ws: any, error: Error) => void; close: (
ws: any,
code: number,
reason: string,
) => void; }

Methods

bunBind(server: BunServer): void
upgrade(request: Request): { socket: WebSocketConnection; response: Response; }