diff --git a/README.md b/README.md index c3e6fa7..02d18c4 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,7 @@ const webSocketHandlers = [ socket: Socket, head: Buffer, proxyRequest: ProxyRequest, + cancelRequest: WebSocketProxyCancelRequest, path: string, context: Record ): Promise => { @@ -189,6 +190,9 @@ const webSocketHandlers = [ 'X-REMOVE_FROM_RESPONSE': null, }, ); + + // alternatively cancel request with custom http status code and message + cancelRequest(418, 'I\'m a teapot'); } } ]