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
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -395,21 +395,21 @@ proxyServer.listen(8015);
395
395
396
396
};
397
397
```
398
-
* **wsInterceptClientMsg**: Is a handler which is called when a websocket message is intercepted on its way to the server from the client. It takes two arguments: `data` - is a websocket message and flags (fin, mask, compress, binary). If falsy value is returned then nothing will be sended to the client.
398
+
* **wsInterceptClientMsg**: Is a handler which is called when a websocket message is intercepted on its way to the server from the client. It takes two arguments: `data` - is a websocket message and `options` in which exists field `req` - websocket request object and `flags` (fin, mask, compress, binary). If falsy value is returned then nothing will be sended to the client.
399
399
```
400
400
const proxy = new HttpProxy({
401
401
...
402
-
wsInterceptClientMsg: (data, flags) {
402
+
wsInterceptClientMsg: (data, options) {
403
403
return typeof data === 'string ? data.toUpperCase() : data;
404
404
}
405
405
...
406
406
})
407
407
```
408
-
* **wsInterceptServerMsg**: Is a handler which is called when a websocket message is intercepted on its way to the client from the server. It takes two arguments: `data` - is a websocket message and flags (fin, mask, compress, binary). If falsy value is returned then nothing will be sended to the target server.
408
+
* **wsInterceptServerMsg**: Is a handler which is called when a websocket message is intercepted on its way to the client from the server. It takes two arguments: `data` - is a websocket message and `options` in which exist fields `req` - websocket request object and `flags` (fin, mask, compress, binary). If falsy value is returned then nothing will be sended to the target server.
409
409
```
410
410
const proxy = new HttpProxy({
411
411
...
412
-
wsInterceptServerMsg: (data, flags) {
412
+
wsInterceptServerMsg: (data, options) {
413
413
return typeof data === 'string ? data.toUpperCase() : data;
0 commit comments