Skip to content

Instantly share code, notes, and snippets.

@un1t
Created December 11, 2015 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save un1t/9f3585d9e9cc441c643c to your computer and use it in GitHub Desktop.
Save un1t/9f3585d9e9cc441c643c to your computer and use it in GitHub Desktop.
python check unix socket
from __future__ import print_function
import socket, sys
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
addr,path = sys.argv[1].split(":")
sock.connect(addr)
sock.send("""GET {} HTTP/1.1
host: test.ru
""".format(path))
print(sock.recv(1024))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment