Interface: WebSocketClientOptions
Extends
UrlOptionsWithConnectionParams
Properties
WebSocket
optional
WebSocket: (url
,protocols
?) =>WebSocket
Ponyfill which WebSocket implementation to use
Parameters
Parameter | Type |
---|---|
url | string | URL |
protocols ? | string | string [] |
Returns
WebSocket
Type declaration
WebSocket.CLOSED
readonly
CLOSED:3
WebSocket.CLOSING
readonly
CLOSING:2
WebSocket.CONNECTING
readonly
CONNECTING:0
WebSocket.OPEN
readonly
OPEN:1
WebSocket.prototype
prototype:
WebSocket
Source
packages/client/src/links/wsLink.ts:44
connectionParams
optional
connectionParams:CallbackOrValue
<null
|Dict
<string
> >
Connection params that are available in createContext()
- For
wsLink
/wsClient
, these are sent as the first message - For
httpSubscriptionLink
, these are serialized as part of the URL under theconnectionParams
query
Source
packages/client/src/links/internals/urlWithConnectionParams.ts:26
Inherited from
UrlOptionsWithConnectionParams.connectionParams
keepAlive
optional
keepAlive:object
Send ping messages to the server and kill the connection if no pong message is returned
Type declaration
keepAlive.enabled
enabled:
boolean
Default
ts
falsets
falsekeepAlive.intervalMs
optional
intervalMs:number
Send a ping message every this many milliseconds
Default
ts
5_000ts
5_000keepAlive.pongTimeoutMs
optional
pongTimeoutMs:number
Close the WebSocket after this many milliseconds if the server does not respond
Default
ts
1_000ts
1_000
Source
packages/client/src/links/wsLink.ts:80
lazy
optional
lazy: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:
number
Close the WebSocket after this many milliseconds
Default
ts
0ts
0lazy.enabled
enabled:
boolean
Enable lazy mode
Default
ts
falsets
false
Source
packages/client/src/links/wsLink.ts:65
onClose
optional
onClose: (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:61
onError
optional
onError: (evt
?) =>void
Triggered when a WebSocket connection encounters an error
Parameters
Parameter | Type |
---|---|
evt ? | Event |
Returns
void
Source
packages/client/src/links/wsLink.ts:57
onOpen
optional
onOpen: () =>void
Triggered when a WebSocket connection is established
Returns
void
Source
packages/client/src/links/wsLink.ts:53
retryDelayMs
optional
retryDelayMs: (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:
CallbackOrValue
<string
>
The URL to connect to (can be a function that returns a URL)
Source
packages/client/src/links/internals/urlWithConnectionParams.ts:19
Inherited from
UrlOptionsWithConnectionParams.url
Generated using TypeDoc and typedoc-plugin-markdown