How do I use proxies with httplib?

Fredrik Lundh fredrik at pythonware.com
Wed Apr 21 17:42:00 EDT 1999


<befletch at my-dejanews.com> wrote:
> I want to use httplib through a proxy server and I can't seem to get
> it to work.

that's probably because it doesn't work:

[Lib]$ grep proxy httplib.py 
[Lib]$

you might be able to use urllib instead:

[Lib]$ grep proxy urllib.py 
            proxy = self.proxies[type]
            type, proxy = splittype(proxy)
            host, selector = splithost(proxy)
            #print "proxy via http:", host, selector
        """Return a dictionary of scheme -> proxy server URL mappings.
        proxies.  An HTTP proxy, for instance, is stored under
        """Return a dictionary of scheme -> proxy server URL mappings.
        Scan the environment for variables named <scheme>_proxy;
            if value and name[-6:] == '_proxy':
[Lib]$

</F>





More information about the Python-list mailing list