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
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -229,7 +229,13 @@ The default implementation forwards the `cookie` header.
229
229
230
230
## `wsReconnect`
231
231
232
-
The `wsReconnect` option contains the configuration for the WebSocket reconnection feature; is an object with the following properties:
232
+
**Experimental.** (default: `disabled`)
233
+
234
+
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).
235
+
The connection is considered broken if the target does not respond to the ping messages or no data is received from the target.
236
+
237
+
The `wsReconnect` option contains the configuration for the WebSocket reconnection feature.
238
+
To enable the feature, set the `wsReconnect` option to an object with the following properties:
233
239
234
240
-`pingInterval`: The interval between ping messages in ms (default: `30_000`).
235
241
-`maxReconnectionRetries`: The maximum number of reconnection retries (`1` to `Infinity`, default: `Infinity`).
@@ -238,9 +244,7 @@ The `wsReconnect` option contains the configuration for the WebSocket reconnecti
238
244
-`connectionTimeout`: The timeout for establishing the connection in ms (default: `5_000`).
239
245
-`reconnectOnClose`: Whether to reconnect on close, as long as the connection from the related client to the proxy is active (default: `false`).
240
246
-`logs`: Whether to log the reconnection process (default: `false`).
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).
243
-
The connection is considered broken if the target does not respond to the ping messages or no data is received from the target.
247
+
-`onReconnect`: A hook function that is called when the connection is reconnected `async onReconnect(oldSocket, newSocket)` (default: `undefined`).
0 commit comments