socks

gevent + requests blocks when using socks

gevent + requests blocks when using socks Question: I use python(2.7.6),gevnet(1.1.2),requests(2.11.1) to make http requests concurrent, and it works good. But when I add socks proxy to requests, it blocks. This is my code: import time import requests import logging import click import gevent from gevent import monkey monkey.patch_all() FORMAT = ‘%(asctime)-15s %(message)s’ logging.basicConfig(format=FORMAT) logger …

Total answers: 1

How to make python Requests work via socks proxy

How to make python Requests work via SOCKS proxy Question: I’m using the great Requests library in my Python script: import requests r = requests.get("http://example.com") print(r.text) I would like to use a SOCKS proxy, how can I do that? Requests seems to only support HTTP proxies. Asked By: lithuak || Source Answers: The modern way: …

Total answers: 9

How can I use a SOCKS 4/5 proxy with urllib2?

How can I use a SOCKS 4/5 proxy with urllib2? Question: How can I use a SOCKS 4/5 proxy with urllib2 to download a web page? Asked By: Mike || Source Answers: Since SOCKS is a socket level proxy, you have to replace the socket object used by urllib2. Please take a look a this …

Total answers: 3