WebSocket: {    CLOSED: 3;    CLOSING: 2;    CONNECTING: 0;    OPEN: 1;    prototype: WebSocket;    new (url: string | URL, protocols?: string | string[]): WebSocket;} Type declaration
- new (url: string | URL, protocols?: string | string[]): WebSocket
- Parameters- url: string | URL
- Optionalprotocols: string | string[]
 
 
- ReadonlyCLOSED: 3
- ReadonlyCLOSING: 2
- ReadonlyCONNECTING: 0
- ReadonlyOPEN: 1