How to expose a UNIX domain socket directly over TCP

You can use socat to export your unix socket as TCP socket. Here is the command to do so:

socat TCP-LISTEN:12345 UNIX-CONNECT:/var/program/program.cmd

This will create TCP socket listening on port 12345 which will connect to mentioned unix socket of your program.

For the deletion issue, I did not test it myself. You can verify it and tell us about it 🙂

Note:
You may not find socat installed, you just need to type: apt-get install socat to install it.

Leave a Comment