eshad / httplib2

Automatically exported from code.google.com/p/httplib2
0 stars 0 forks source link

Support for proxy... (Python 3) #205

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Using python 3 and SocksiPy library (socksipy-branch 
http://code.google.com/p/socksipy-branch/)
(socksipy-branch is working with python 3)

but
import httplib2
import socks

h = httplib2.Http(proxy_info = httplib2.ProxyInfo(socks.PROXY_TYPE_HTTP, 
ProxyHostname, ProxyPort))
r,c = h.request("http://automation.whatismyip.com/n09230945.asp")

gives no effect, while:

socks.setdefaultproxy(socks.PROXY_TYPE_HTTP, Hostname, Port)
socks.wrapmodule(httplib2)
h = httplib2.Http()
r,c = h.request("http://automation.whatismyip.com/n09230945.asp")

does work :)

I would prefer the former and full support for proxies ;)

Original issue reported on code.google.com by davispuh on 18 Mar 2012 at 2:16