interface WSOptions {
    automaticOpen?: boolean;
    debug?: boolean;
    protocols?: string | string[];
    retry?: OperationOptions;
    shouldRetry?: ShouldRetryFn;
    timeout?: number;
    ws?: new (url: string | URL, protocols?: string | string[]) => WebSocket;
}

Properties

automaticOpen?: boolean

Automatically open the connection

true
debug?: boolean

Enable debug mode. This will log all events to the console.

DEBUG=iso-web:ws node test.js will also enable debug mode

false
protocols?: string | string[]
retry?: OperationOptions

Retry options

shouldRetry?: ShouldRetryFn

Function to determine if the connection should be retried

Retries by default on all close events except 1008 (HTTP 400 equivalent) and 1011 (HTTP 500 equivalent) and connection timeout events

The close or connection timeout event

timeout?: number

Timeout in milliseconds for the connection to be established

5000
ws?: new (url: string | URL, protocols?: string | string[]) => WebSocket