You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -232,15 +232,15 @@ The default implementation forwards the `cookie` header.
232
232
The `wsReconnect` option contains the configuration for the WebSocket reconnection feature; is an object with the following properties:
233
233
234
234
-`pingInterval`: The interval between ping messages in ms (default: `30_000`).
235
-
-`maxReconnectionRetries`: The maximum number of reconnection attempts (default: `3`). The counter is reset when the connection is established.
235
+
-`maxReconnectionRetries`: The maximum number of reconnection retries (`1` to `Infinity`, default: `Infinity`).
236
236
-`reconnectInterval`: The interval between reconnection attempts in ms (default: `1_000`).
237
237
-`reconnectDecay`: The decay factor for the reconnection interval (default: `1.5`).
238
-
-`connectionTimeout`: The timeout for the connection in ms (default: `5_000`).
239
-
-`reconnectOnClose`: Whether to reconnect on close, as long as the source connection is active (default: `false`).
238
+
-`connectionTimeout`: The timeout for establishing the connection in ms (default: `5_000`).
239
+
-`reconnectOnClose`: Whether to reconnect on close, as long as the connection from the related client to the proxy is active (default: `false`).
240
240
- TODO logs option?
241
241
242
-
Reconnection feature detects and closes broken connections and reconnects automatically, see [how to detect and close broken connections](https://github.com/websockets/ws#how-to-detect-and-close-broken-connections); the mechanism is based on ping/pong messages.
243
-
It verifies the connection status from the service to the target.
242
+
Reconnection feature detects and closes broken connections and reconnects automatically, see [how to detect and close broken connections](https://github.com/websockets/ws#how-to-detect-and-close-broken-connections).
243
+
The connection is considered broken if the target does not respond to the ping messages or no data is received from the target.
t.throws(()=>validateOptions({ ...requiredOptions,wsReconnect: {maxReconnectionRetries: 0}}),'wsReconnect.maxReconnectionRetries must be a number greater than or equal to 1')
18
+
t.throws(()=>validateOptions({ ...requiredOptions,wsReconnect: {maxReconnectionRetries: -1}}),'wsReconnect.maxReconnectionRetries must be a number greater than or equal to 1')
19
+
t.throws(()=>validateOptions({ ...requiredOptions,wsReconnect: {maxReconnectionRetries: '1'}}),'wsReconnect.maxReconnectionRetries must be a number greater than or equal to 1')
t.throws(()=>validateOptions({ ...requiredOptions,wsReconnect: {reconnectInterval: 0}}),'wsReconnect.reconnectInterval (ms) must be a number greater than or equal to 100')
23
+
t.throws(()=>validateOptions({ ...requiredOptions,wsReconnect: {reconnectInterval: -1}}),'wsReconnect.reconnectInterval (ms) must be a number greater than or equal to 100')
24
+
t.throws(()=>validateOptions({ ...requiredOptions,wsReconnect: {reconnectInterval: '1'}}),'wsReconnect.reconnectInterval (ms) must be a number greater than or equal to 100')
t.throws(()=>validateOptions({ ...requiredOptions,wsReconnect: {reconnectDecay: 0}}),'wsReconnect.reconnectDecay must be a number greater than or equal to 1')
28
+
t.throws(()=>validateOptions({ ...requiredOptions,wsReconnect: {reconnectDecay: -1}}),'wsReconnect.reconnectDecay must be a number greater than or equal to 1')
29
+
t.throws(()=>validateOptions({ ...requiredOptions,wsReconnect: {reconnectDecay: '1'}}),'wsReconnect.reconnectDecay must be a number greater than or equal to 1')
t.throws(()=>validateOptions({ ...requiredOptions,wsReconnect: {connectionTimeout: -1}}),'wsReconnect.connectionTimeout must be a non-negative number')
33
+
t.throws(()=>validateOptions({ ...requiredOptions,wsReconnect: {connectionTimeout: '1'}}),'wsReconnect.connectionTimeout must be a non-negative number')
0 commit comments