Skip to content

Commit 47c03a4

Browse files
committed
docs: fix mistakes
1 parent 600866b commit 47c03a4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,6 @@ If you are using the `proxyServer.listen` method, the following options are also
435435
* `proxyReq`: This event is emitted before the data is sent. It gives you a chance to alter the proxyReq request object. Applies to "web" connections
436436
* `proxyReqWs`: This event is emitted before the data is sent. It gives you a chance to alter the proxyReq request object. Applies to "websocket" connections
437437
* `proxyRes`: This event is emitted if the request to the target got a response.
438-
* `wsClientMsg`: This event is emitted after webscoket mesage is sended from the client to the server.
439-
* `wsServerMsg`: This event is emitted after websocket message is sended from the server to the client.
440438
* `open`: This event is emitted once the proxy websocket was created and piped into the target websocket.
441439
* `close`: This event is emitted once the proxy websocket was closed.
442440
* (DEPRECATED) `proxySocket`: Deprecated in favor of `open`.
@@ -493,6 +491,8 @@ proxy.on('close', function (res, socket, head) {
493491

494492
* `clientSender`: This event is emitted after websocket sender from client to server is initialized
495493
* `serverSender`: This event is emitted after websocket sender from server to client is initialized
494+
* `wsClientMsg`: This event is emitted after webscoket message is sended from the client to the server.
495+
* `wsServerMsg`: This event is emitted after websocket message is sended from the server to the client.
496496

497497
```js
498498
httpProxy.createServer({
@@ -512,6 +512,9 @@ proxyServer.on('proxyReqWs', (proxyReq, req, socket, options, head) => {
512512
proxyReq.on('serverSender', (serverSender) => {
513513
serverSender.send('hello, client');
514514
});
515+
516+
proxyReq.on('wsClientMsg', console.log);
517+
proxyReq.on('wsServerMsg', console.log);
515518
});
516519
```
517520

0 commit comments

Comments
 (0)