Skip to content

WebSocket

WebSocket: {(url, protocols?): WebSocket; CLOSED: number; CLOSING: number; CONNECTING: number; OPEN: number; prototype: WebSocket; READY_STATE_CLOSED: number; READY_STATE_CLOSING: number; READY_STATE_CONNECTING: number; READY_STATE_OPEN: number; }

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250725.0/node_modules/@cloudflare/workers-types/index.ts:2825

Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.

MDN Reference

string

string | string[]

WebSocket

readonly CLOSED: number

readonly CLOSING: number

readonly CONNECTING: number

readonly OPEN: number

prototype: WebSocket

readonly READY_STATE_CLOSED: number

readonly READY_STATE_CLOSING: number

readonly READY_STATE_CONNECTING: number

readonly READY_STATE_OPEN: number