Created
December 11, 2015 11:02
-
-
Save un1t/9f3585d9e9cc441c643c to your computer and use it in GitHub Desktop.
python check unix socket
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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