Re: can httplib.HTTPConnection use proxy?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: can httplib.HTTPConnection use proxy?

From: adam <adam_goucher@hotmail.com>
Date: Thu Mar 16 2006 - 15:46:10 CET

>>> import httplib
>>> h = httplib.HTTPConnection("www.google.ca")
>>> h.connect()
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
  File "C:\Python24\lib\httplib.py", line 627, in connect
    raise socket.error, msg
error: (10061, 'Connection refused')
>>> h2 = httplib.HTTPConnection("my.proxy.host", "my.proxy.port")
>>> h2.connect()
>>> h2.request("GET", "http://www.google.ca")
>>> resp = h2.getresponse()
>>> page = resp.read()
Received on Sun Apr 30 12:00:20 2006