【发布时间】:2010-09-01 11:10:59
【问题描述】:
您好,我正在尝试使用带有套接字模块的受保护 http socks 服务器,如下所示
>>> import socket
>>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> host = '@987654321@'
>>> port = 8888
>>> s.bind((host, port))
它给了我错误:
socket.gaierror: [Errno -2] Name or service not known
虽然如果我在 Firefox 上设置代理,它可以正常工作。代码是什么?
苏丹
【问题讨论】:
-
我不熟悉
protected http socks server,我认为您的意思是经过身份验证的 HTTP 代理或 SOCKS 代理。这两种不同的协议不能轻易地在同一个端口上运行。是哪个?