httplib and Proxy

Chris Gray cpgray at
Thu Nov 20 16:28:11 CET 2003

On Thu, 20 Nov 2003, Rolf Wester wrote:
> I want to fetch some web-pages via http. I know how to do this without a
> proxy server in between but unfortunately we can only access the
> internet via a proxy. I would be very appriciative if anybody could tell
> me how to do this.
> Thanks in advance
> Rolf Wester
> P.S.: I would not mind to use sockets directly

You can use httplib.  The the host and port for the HTTPConnection should
be the proxy server and the URL for the request should include the host
name.  For instance:

h1 = httplib.HTTPConnection("", 80)
h1.request("GET", "")

Chris Gray

"Okey dokey.. free my mind. Right, no problem, free my mind, free my mind,
no problem, right... "  -The Matrix

More information about the Python-list mailing list