Interface: WebSocketClientOptions
Properties
WebSocket
optionalWebSocket: (url,protocols?) =>WebSocket
Ponyfill which WebSocket implementation to use
Parameters
| Parameter | Type |
|---|---|
url | string | URL |
protocols? | string | string[] |
Returns
WebSocket
Type declaration
WebSocket.CLOSED
readonlyCLOSED:3WebSocket.CLOSING
readonlyCLOSING:2WebSocket.CONNECTING
readonlyCONNECTING:0WebSocket.OPEN
readonlyOPEN:1WebSocket.prototype
prototype:
WebSocket
Source
packages/client/src/links/wsLink.ts:44
lazy
optionallazy:object
Lazy mode will close the WebSocket automatically after a period of inactivity (no messages sent or received and no pending requests)
Type declaration
lazy.closeMs
closeMs:
numberClose the WebSocket after this many milliseconds
Default
ts0ts0lazy.enabled
enabled:
booleanEnable lazy mode
Default
tsfalsetsfalse
Source
packages/client/src/links/wsLink.ts:61
onClose
optionalonClose: (cause?) =>void
Triggered when a WebSocket connection is closed
Parameters
| Parameter | Type |
|---|---|
cause? | object |
cause.code? | number |
Returns
void
Source
packages/client/src/links/wsLink.ts:57
onOpen
optionalonOpen: () =>void
Triggered when a WebSocket connection is established
Returns
void
Source
packages/client/src/links/wsLink.ts:53
retryDelayMs
optionalretryDelayMs: (attemptIndex) =>number
The number of milliseconds before a reconnect is attempted.
Default
ts{@link exponentialBackoff}
ts{@link exponentialBackoff}
Parameters
| Parameter | Type |
|---|---|
attemptIndex | number |
Returns
number
Source
packages/client/src/links/wsLink.ts:49
url
url:
string| () =>MaybePromise<string>
The URL to connect to (can be a function that returns a URL)
Source
packages/client/src/links/wsLink.ts:40
Generated using TypeDoc and typedoc-plugin-markdown