How to access Unix Domain Sockets from the command line? How to access Unix Domain Sockets from the command line? unix unix

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


nc -U </unix/socket> almost in any Linux, BSD, MacOs.