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.
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”
readonly
CLOSED:number
CLOSING
Section titled “CLOSING”
readonly
CLOSING:number
CONNECTING
Section titled “CONNECTING”
readonly
CONNECTING:number
readonly
OPEN:number
prototype
Section titled “prototype”prototype:
WebSocket
READY_STATE_CLOSED
Section titled “READY_STATE_CLOSED”
readonly
READY_STATE_CLOSED:number
READY_STATE_CLOSING
Section titled “READY_STATE_CLOSING”
readonly
READY_STATE_CLOSING:number
READY_STATE_CONNECTING
Section titled “READY_STATE_CONNECTING”
readonly
READY_STATE_CONNECTING:number
READY_STATE_OPEN
Section titled “READY_STATE_OPEN”
readonly
READY_STATE_OPEN:number