简体   繁体   中英

Is it possible to proxy a websocket connection from the client side?

Here's the scenario. We have a webapp that communicates actions bidirectionally through websockets. I was wondering if it is possible to build a separate program (or use something existing) to "listen" in on the connection and log the messages of that link. Preferably it would be resident on the client side. Is this possible?

The idea is, we want to know every message that goes across the ws without having to modify either program to install this logging mechanism.

Yes it is. After a few days of playing around, you can use node-http-proxy to set up a proxy using node's socket library. This npm package also includes websocket proxying through HTTPS or HTTP.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM