How to access Unix Domain Sockets from the command line?
You can use ncat
command from the nmap
project:
ncat -U /tmp/tbsocket1
To make it easy to access, you can do this:
# forward incoming 8080/tcp to unix socketncat -vlk 8080 -c 'ncat -U /tmp/tbsocket1'# make a http request via curlcurl http://localhost:8080
You can also use socat
:
# forward incoming 8080/tcp to unix socketsocat -d -d TCP-LISTEN:8080,fork UNIX:/tmp/tbsocket1