Part of bzrlib.transport.http._urllib2_wrappers View In Hierarchy
Copied and modified from urllib2 to be able to modify the request during the request pre-processing instead of modifying it at _open time. As we capture (or create) the connection object during request processing, _open time was too late.
The main task is to modify the request so that the connection is done to the proxy while the request still refers to the destination host.
Note: the proxy handling may modify the protocol used; the request may be against an https server proxied through an http proxy. So, https_request will be called, but later it's really http_open that will be called. This explains why we don't have to call self.parent.open as the urllib2 did.
Method | __init__ | Undocumented |
Method | get_proxy_env_var | Get a proxy env var. |
Method | proxy_bypass | Check if host should be proxied or not. |
Method | evaluate_proxy_bypass | Check the host against a comma-separated no_proxy list as a string. |
Method | set_proxy | Undocumented |
Note that we indirectly rely on urllib.getproxies_environment taking into account the uppercased values for proxy variables.
Returns | True to skip the proxy, False otherwise. |