diff --git a/README.md b/README.md index efbb8d0..20c34d9 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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`). diff --git a/examples/reconnection/ReconnectionExample.md b/examples/reconnection/ReconnectionExample.md index 675e939..2f8636d 100644 --- a/examples/reconnection/ReconnectionExample.md +++ b/examples/reconnection/ReconnectionExample.md @@ -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.