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
+22-2Lines changed: 22 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -227,7 +227,7 @@ It also supports an additional `rewriteRequestHeaders(headers, request)` functio
227
227
opening the WebSocket connection. This function should return an object with the given headers.
228
228
The default implementation forwards the `cookie` header.
229
229
230
-
## `wsReconnect`
230
+
###`wsReconnect`
231
231
232
232
**Experimental.** (default: `disabled`)
233
233
@@ -247,7 +247,7 @@ To enable the feature, set the `wsReconnect` option to an object with the follow
247
247
248
248
See the example in [examples/reconnection](examples/reconnection).
249
249
250
-
##wsHooks
250
+
### `wsHooks`
251
251
252
252
On websocket events, the following hooks are available, note **the hooks are all synchronous**.
253
253
The `context` object is passed to all hooks and contains the `log` property.
@@ -259,6 +259,26 @@ The `context` object is passed to all hooks and contains the `log` property.
259
259
-`onReconnect`: A hook function that is called when the connection is reconnected `onReconnect(context, source, target)` (default: `undefined`). The function is called if reconnection feature is enabled.
260
260
-`onPong`: A hook function that is called when the target responds to the ping `onPong(context, source, target)` (default: `undefined`). The function is called if reconnection feature is enabled.
0 commit comments