Closed davidtaddei closed 10 months ago
I'm afraid that is not possible. websockify is a completely transparent proxy, meaning that it has no idea what the traffic it proxies actually means. So it cannot determine things like which data can be shared between multiple clients.
I would suggest building something custom that is more aware of the protocol you wish to proxy. Some components from websockify might still be interesting for you as a base, though. E.g. the WebSocket socket wrapper class.
Great work on this project, I do have a question regarding scaling users however.
Currently each client connected via websockets has a new TCP connection established to the target machine, even if they are initiated from the same source and using the same credentials etc. As such the bandwidth consumed between websockify and a target machine grows as the number of connected websocket clients grows.
Is it possible to connection pool based on the target machine and allow traffic flowing from TCP -> Websockets to be replicated at the websocket layer instead of being carried through concurrent TCP connections? Even a simple strategy similar to replicated load balancing would be helpful where all connected websocket clients want to receive the same data.