如题。

见:

https://superuser.com/questions/484671/can-i-monitor-a-local-unix-domain-socket-like-tcpdump?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

用socat

sudo mv /path/to/sock /path/to/sock.original
sudo socat -t100 -x -v UNIX-LISTEN:/path/to/sock,mode=,reuseaddr,fork UNIX-CONNECT:/path/to/sock.original

What is happening above: First move original socket to sock.original. Socat creates a new socket ('UNIX-LISTEN') in the originals location and forwards all to the original ('UNIX-connect'). The -v tells socat to also print output to STDERR.

04-25 02:07
查看更多