To allow you to connect to tcp socket and have that redirected to another tcp socket by way of a unix domain socket.
+-----+ +-------------------+ +-----+
| tcp | <----> | unix domainsocket | <----> | tcp |
+-----+ +-------------------+ +-----+
The proxy has two components
- serve
- listen to a tcp port and proxying the connection to a unix domain socket
- forward
- listen to a unix domain socket and forwarding to the desired tcp socket
Lets say you have an existing app on port 80 and you want to expose it on port 9999
launch the forwarder
.\domain-socket-proxy.exe forward --address :80 --path .\unix.socket
launch the server
.\domain-socket-proxy.exe serve --address localhost:9999 --path .\unix.socket
The above example uses the file path .\unix.socket
for the unix domain socket
You can use a container for the serve as well
docker run -v c:\tmp:c:\tmp --rm --name socket knicknic/domain-socket-proxy:v1.0.0 --path c:\tmp\unix.socket --address :9999