面向python的socks5代理客户端
Ermes的Python项目详细描述
简介
ermes是一个针对python的socks5实现(仅限3.x),其用法是 直截了当。
from ermes import Socks5Proxy, Socks5Error import socket proxy = Socks5Proxy(("the.host.of.proxy", 1080), username="the username no more than 255 chars or None", password="the password no more than 255 chars or None", remote_dns=True) sock = socket.socket() # use proxy.connect(sock, address) # instead of sock.connect(address), proxy.connect(sock, ("the.remote.host", 80)) # just do anything like a usual socket with `sock`
限制
- 身份验证支持有限,只有0x00(无身份验证)和0x02 支持(用户名/密码)
- 仅支持命令代码0x01(TCP/IP流)
- 不支持IPv6
- 仅限袜子5