Proxying UDP over SOCKS5 proxy in Python

只谈情不闲聊 提交于 2019-12-05 05:43:05

Have you tried to use connect() and send() instead of sendto()? Judging from the SocksiPy source code, connectionless mode isn't implemented.

Edit:

req = struct.pack('BBB', 0x05, 0x01, 0x00)

TCP stream connection (0x01) seems to be hardcoded here. SocksiPy as it is won't work.

Have you tried this:

socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "socks.proxy.lan", 8080, True)

replace 8080 with the port and "True" is True if you want rdns enabled.

If you are using Python version 3 and above i suggest you use PySocks and it would be

socks.set_default_proxy(socks.PROXY_TYPE_SOCKS5, "socks.proxy.lan", 8080, True)
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!