You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-2
Original file line number
Diff line number
Diff line change
@@ -435,8 +435,6 @@ If you are using the `proxyServer.listen` method, the following options are also
435
435
* `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
436
436
* `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
437
437
* `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.
440
438
* `open`: This event is emitted once the proxy websocket was created and piped into the target websocket.
441
439
* `close`: This event is emitted once the proxy websocket was closed.
442
440
* (DEPRECATED) `proxySocket`: Deprecated in favor of `open`.
@@ -489,6 +487,39 @@ proxy.on('close', function (res, socket, head) {
489
487
490
488
**[Back to top](#table-of-contents)**
491
489
490
+
### Listening for websocket proxy request events
491
+
492
+
*`clientSenderInited`: This event is emitted after websocket sender from client to server is initialized.
493
+
*`serverSenderInited`: 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.
496
+
497
+
```js
498
+
httpProxy.createServer({
499
+
target:'ws://localhost:9014',
500
+
ws:true
501
+
}).listen(8014);
502
+
503
+
proxyServer.on('upgrade', function (req, socket, head) {
0 commit comments