Skip to content

Commit

Permalink
docs(ws): add details about cancelRequest functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-tkachenko committed Nov 10, 2023
1 parent 54c309a commit b28b30b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ const webSocketHandlers = [
socket: Socket,
head: Buffer,
proxyRequest: ProxyRequest,
cancelRequest: WebSocketProxyCancelRequest,
path: string,
context: Record<string, any>
): Promise<void> => {
Expand Down Expand Up @@ -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');
}
}
]
Expand Down

0 comments on commit b28b30b

Please sign in to comment.