Sample Header Ad - 728x90

How to create a socket forwarder as a server?

2 votes
2 answers
2270 views
I'm looking for a tool that starts a socket server, and forwards incoming requests on that socket port to another internal one. I found socat is able to forward socket ports in general: socat tcp-l:8080,fork,reuseaddr tcp:127.0.0.1:12345 This forwards the "official" port 8080 to internal socket port 12345 successfully. BUT: my problem is that clients should be able to connect to port 8080 *even* if internal port 12345 is currently unavailable. The problem with socat is that it does not seem to create a real socket server, but justs remapps the port, and just puts the port on LISTENING. I'm looking for a tool that tells the client "You connected successfully, please send me your input". And if my local port 12345 is not available, the clients should get an error when trying to send data. So in case my local application is down, clients should still be able to establish a connection to that official ort. Is that possible without having to write my own tool?
Asked by membersound (490 rep)
Jul 8, 2019, 11:22 AM
Last activity: Aug 6, 2025, 07:06 AM