Reading a Unix Domain Socket file using Python is similar to a regular TCP socket:
>>> import socket >>> import sys >>> >>> server_address = '/tmp/tbsocket1'
Since UDS are not regular files, cat does not work with them:
$ sudo cat /tmp/tbsocket1 cat: /tmp/tbsocket1: No such device or address
Nobody does curl :
$ sudo curl /tmp/tbsocket1 curl: (3) <url> malformed
How to read or write to Unix domain sockets using standard command line tools like curl?
PS: By a strange coincidence, a patch for curls was recently proposed)
linux unix curl unix-socket unix-domain-sockets
Adam matan
source share