为什么socks.socksocket()不起作用connect()

时间:2018-04-14 18:28:24

标签: python-3.x sockets proxy

我有SOCKS5代理 - 104.219.251.135:32832

import socks
s = socks.socksocket()
s.set_proxy(socks.SOCKS5, "104.219.251.135","32832")
s.connect(("www.google.com" , 80))

我发现错误:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/socks.py", line 100, in wrapper
  return function(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/socks.py", line 832, in connect
   super(socksocket, self).connect(proxy_addr)
TypeError: an integer is required (got type str)
为什么?如何解决?

如何检查代理的有效性和知道代理类型?

0 个答案:

没有答案