LoginSignup
28
31

More than 5 years have passed since last update.

socatでunixドメインソケットにつなぐ

Last updated at Posted at 2014-02-26

tcpソケットではなく、unixドメインソケットをlisten起動しているサーバ(unicornとか)に対して直接ターミナルからつなぎたいときがある。

tcpソケットならtelnetをつかえばよいが、unixドメインソケットにはつなげない。

socatを使えば簡単にunixドメインソケットにもつなげられる

以下のようにstdinとソケットへのパスを引数にわたせばよい

$ sudo apt-get install socat
$ echo -en 'GET / HTTP/1.0\r\n\r\n' | socat stdio /tmp/.sock

参考

28
31
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
28
31