如何将套接字(或袜子)与代理一起使用并将数据从该代理发送到网站?
因此,正如标题中提到的,我希望能够使用套接字模块或袜子模块通过代理匿名发送数据到 IP(我知道这可以使用不同的模块来完成,但我想要这个特定的模块)因为我可以更好地理解它)
我已经使用了袜子模块,如下所示..但我总是收到一条错误消息“无法建立连接,因为目标机器主动拒绝它”..我尝试了许多不同的代理运气不好..所以我想我正在做某事这里错了..有什么想法吗?
import socks
Socket=socks.socksocket()
Socket.setproxy(socks.PROXY_TYPE_SOCKS4,"(ProxyIP)",(ProxyPort))
Socket.connect(("(WebsiteIP or Domain Name)",(WebsitePort)))
Socket.close()
print ("connected")
我也尝试过这个但得到了同样的错误
Python 套接字模块。连接到 HTTP 代理,然后对外部资源执行 GET 请求
So as mentioned in the title I want to be able to send data to an ip anonymously through a proxy using the sockets module.. or the socks module.. (i know that this can be done with different modules but i want this specific one because i can better understand it)
i have used the socks module as shown below.. but i always get an error saying "No connection could be made because the target machine actively refused it".. i have tried a number of different proxies an got no luck.. so im thinking that im doing something wrong here.. any ideas?
import socks
Socket=socks.socksocket()
Socket.setproxy(socks.PROXY_TYPE_SOCKS4,"(ProxyIP)",(ProxyPort))
Socket.connect(("(WebsiteIP or Domain Name)",(WebsitePort)))
Socket.close()
print ("connected")
Also i have tried this but got the same error
Python socket module. Connecting to an HTTP proxy then performing a GET request on an external resource
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论