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
I created a proxy to redirect websocket connections to another websocket server like:
websocket client <-----> proxy <-----> websocket target server
In order to control the messages that sent from client to the sever, I would like to know what messages are sent to the server and do some filtering. I found the following codes helping me to get the sent messages but I can't filter the unwanted messages (such as 'hello'). Is there another method I can use to add some logic before the messages are sent to target server ?
proxy.on('proxyReqWs', function(proxyReq, req, socket, res, options) {
var parser = new WsParser(0, false);
socket.pipe(parser);
parser.on('frame', function (frame) {
// handle the frame
console.log('Up:',frame);
console.log('Up data:'+frame.data);
});
});
The text was updated successfully, but these errors were encountered:
I created a proxy to redirect websocket connections to another websocket server like:
websocket client <-----> proxy <-----> websocket target server
In order to control the messages that sent from client to the sever, I would like to know what messages are sent to the server and do some filtering. I found the following codes helping me to get the sent messages but I can't filter the unwanted messages (such as 'hello'). Is there another method I can use to add some logic before the messages are sent to target server ?
proxy.on('proxyReqWs', function(proxyReq, req, socket, res, options) {
var parser = new WsParser(0, false);
socket.pipe(parser);
parser.on('frame', function (frame) {
// handle the frame
console.log('Up:',frame);
console.log('Up data:'+frame.data);
});
});
The text was updated successfully, but these errors were encountered: