Assume a legacy Linux application listening on a UNIX domain socket /tmp/foo
.
In addition to communicating with this legacy application over the UNIX domain socket mechanism I want to be able to connect to it via a TCP-connection on port say 1234.
What is the easiest way to bind to TCP port 1234 and then redirect all incoming connections to the UNIX domain socket /tmp/foo
?
Best Answer
Turns out socat can be used to achieve this:
And with a bit of added security:
These examples have been tested and work as expected.