urllib3 ProxyManager

ProxyManager is an HTTP proxy-aware subclass of PoolManager. It produces a single
HTTPConnectionPool instance for all HTTP connections and individual per-server:port
HTTPSConnectionPool instances for tunnelled HTTPS connections.

headers = urllib3.make_headers(proxy_basic_auth=’myusername:mypassword’)
proxy = urllib3.ProxyManager(’http://localhost:3128’, proxy_headers=headers)
r = proxy.request(’GET’, ’http://example.com/’)
r.status

API

posted on 2016-03-16 17:26  fqzhang  阅读(1405)  评论(0编辑  收藏  举报

导航