node-http-proxy
node-http-proxy copied to clipboard
Modify WebSocket messages
trafficstars
While I've successfully managed to proxy WebSocket messages, and even log the data by listening to the 'data' event, I haven't found a way to modify the sent data. Is it possible to add a "hook" between the receiving and sending of the WebSocket messages from the client to the target and vice-versa?
It would be great if there was an event that would be called every time a new chunk of live websocket data comes through the proxy and that would allow me to override it.
Please let me know if there is already a way to achieve this. Thank you.