Eric
Eric

Reputation: 19873

Websocket server passthrough to another port

I have an existing server running a telnet application. I want to make a web interface to connect to that application using web socket. However I would like to avoid modifying the application. Websockets seem to required special handshaking and HTTP like header processing.

Is it possible to reuse some existing web server to act as a pass through to my application? Something like this

[ ws client ] ----> [ magic server ] -----> [ telnet app ]

The magic server would handle the ws connection then forward everything to the telnet app. I'm very open to any kind of solution, from node.js to apache obscure plugins, I would just like to avoid coding the magic server myself.

Upvotes: 1

Views: 1674

Answers (1)

Eric
Eric

Reputation: 19873

I ended up using websockify which support python, node.js, ruby and C. It acts as a pass through bridge that handles websocket connections on one end and connects another TCP socket on the other end.

This effectively translates WebSockets to TCP transparently. Relevant google search keywords were websocket to tcp, then autocomplete suggested socket bridge which lead directly to this project

Upvotes: 1

Related Questions