28
31

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?