Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
gevent + requests blocks when using socks #3861
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:
These pictures show the result.
Can anyone help me solving this problem? Thanks very much!
My best guess is that you are monkeypatching too late. When using gevent you must monkeypatch first, before importing anything else. Doing it later runs the risk of breaking anything that has done a
Can you try moving your import and monkeypatch to the very top of your file before doing anything else?
Yeah, ' moving your import and monkeypatch to the very top of your file ' solved my problem! Thank you very much!
This suggestion also solves my project's problem.
Thank you again!