【发布时间】:2017-10-10 17:44:16
【问题描述】:
我在我的项目中使用 IPv4 作为 socks,但我需要在我的项目中连接 IPv6 socks。
IPv6:(例如)
ip:1.1.1.1
端口:1080
用户名:用户名
密码:密码
我的代码:
import socks
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "{}".format(proxy_row['ip']), proxy_row['port'], True, 'username', 'password')
socket.socket = socks.socksocket
url = 'http://website.domain'
response = f.get(url, timeout=10)
【问题讨论】:
-
不确定是什么问题。我猜测(您没有指定)您使用的是this library,这暗示它适用于 IPv6,但没有错误(甚至没有解释),我无法告诉您出了什么问题。
-
@aidan.plenert.macdonald 嗨,运行代码
f.get...后显示此错误:raise SOCKS5Error("{0:#04x}: {1}".format(status, error)) SOCKS5Error: 0x05: Connection refused -
来自here,
0x05 - Connection refused - The target server has actively refused the connection (the requested port is closed). -
@aidan.plenert.macdonald 我的英语不太好请多指教