PySocks installation method

PySocks is a Python-based SOCKS proxy client, which is a branch of SocksiPy, modifying some bug and added some extra features.

------------------------------------------------------------------------

0x01 Installation

git clone https://github.com/Anorov/PySocks
cd PySocks
python setup.py install

Use 0x02

import socks
s = socks.socksocket() 
s.set_proxy(socks.SOCKS5, "localhost", 1080)
s.connect(("www.pcat.cc", 80))
s.sendall("GET / HTTP/1.1 ...")
print s.recv(4096)

 

Guess you like

Origin www.cnblogs.com/lee-qi/p/11839471.html