I am having trouble finding solid examples of how to build a simple script in urllib3 which opens a url (via a proxy), then reads it and finally prints it. The proxy requires a user/pass to authenticate however it's not clear to me how you do this? Any help would be appreciated.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
urllib3 has a
ProxyManager
component which you can use. You'll need to build headers for the Basic Auth component, you can either do that manually or use themake_headers
helper in urllib3.All together, it would look something like this:
I believe the correct answer to this should be
(note: proxy_basic_auth, not basic_auth)
I was trying this with basic_auth in my environment without any luck. shazow you committed this comment to git which pointed me in the right direction