Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ An array that contains the routes to handle. Default: `['/', '/*']`.

### `preRewrite`

A function that will be executed before rewriting the URL. It receives the URL, the request parameters and the prefix and must return the new URL.
A function that will be executed before rewriting the URL. It receives the URL, the request parameters and the prefix and must return the new URL.

The function cannot return a promise.

Expand Down Expand Up @@ -271,7 +271,7 @@ See the example in [examples/reconnection](examples/reconnection).

### `wsHooks`

On websocket events, the following hooks are available, note **the hooks are all synchronous**.
On websocket events, the following hooks are available, note **the hooks are all synchronous**.
The `context` object is passed to all hooks and contains the `log` property.

- `onIncomingMessage`: A hook function that is called when the request is received from the client `onIncomingMessage(context, source, target, { data, binary })` (default: `undefined`).
Expand Down
2 changes: 1 addition & 1 deletion examples/reconnection/ReconnectionExample.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ Examples of how hooks can be used based on the target service type:
- GraphQL subscriptions: Resend the subscription from the last received message.
- Message brokers: Resend messages starting from the last successfully processed message.

In this example, the proxy re-sends the messages from the last ping to ensure all the messages are sent to the target, without any additional logic.
In this example, the proxy re-sends the messages from the last ping to ensure all the messages are sent to the target, without any additional logic.
Resending messages from the last pong ensures that the target does not miss any messages, but it may send messages more than once.
Loading