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.20250923.0/node_modules/@cloudflare/workers-types/index.ts:2823
Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
Type Declaration
Section titled “Type Declaration”Parameters
Section titled “Parameters”string
protocols?
Section titled “protocols?”string | string[]
Returns
Section titled “Returns”CLOSED
Section titled “CLOSED”
readonlyCLOSED:number
CLOSING
Section titled “CLOSING”
readonlyCLOSING:number
CONNECTING
Section titled “CONNECTING”
readonlyCONNECTING:number
readonlyOPEN:number
prototype
Section titled “prototype”prototype:
WebSocket
READY_STATE_CLOSED
Section titled “READY_STATE_CLOSED”
readonlyREADY_STATE_CLOSED:number
READY_STATE_CLOSING
Section titled “READY_STATE_CLOSING”
readonlyREADY_STATE_CLOSING:number
READY_STATE_CONNECTING
Section titled “READY_STATE_CONNECTING”
readonlyREADY_STATE_CONNECTING:number
READY_STATE_OPEN
Section titled “READY_STATE_OPEN”
readonlyREADY_STATE_OPEN:number