Issue 113 in httplib2: Proxy doesn't work

31 views
Skip to first unread message

codesite...@google.com

unread,
Sep 17, 2010, 9:10:50 AM9/17/10
to httplib...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 113 by jan.seif...@fotkyzcest.net: Proxy doesn't work
http://code.google.com/p/httplib2/issues/detail?id=113

Proxy doesn't work if my local DNS server doesn't know hostname. For
example, I need connect to http://api.intranet.dev/mailapi.php. However,
intranet.dev is fake domain, it's doesn't exist in DNS, so I have to use
proxy server 192.168.1.50:8000:

import httplib2
proxy_info = httplib2.ProxyInfo(
proxy_type = httplib2.socks.PROXY_TYPE_HTTP,
proxy_host = '192.168.1.50',
proxy_port = 8000,
proxy_rdns = True
)
h = httplib2.Http(proxy_info = proxy_info)
r, c = h.request('http://api.intranet.dev/mailapi.php')

It doesn't work:

ServerNotFoundError: Unable to find the server at api.intranet.dev

Problem is in the HTTPConnectionWithTimeout.connect(). There is:

for res in socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM):

In my example socket.getaddrinfo can't reverse self.host. There is patch
which solve this problem. However, only in python2 subtree, because I
haven't used Python 3.


Attachments:
proxy.patch 2.5 KB

codesite...@google.com

unread,
Jun 13, 2011, 2:34:33 PM6/13/11
to httplib...@googlegroups.com

Comment #2 on issue 113 by joe.gregorio: Proxy doesn't work
http://code.google.com/p/httplib2/issues/detail?id=113

socks.py has been updated to latest.

codesite...@google.com

unread,
Jun 13, 2011, 2:38:43 PM6/13/11
to httplib...@googlegroups.com
Updates:
Status: Fixed

Comment #1 on issue 113 by joe.gregorio: Proxy doesn't work
http://code.google.com/p/httplib2/issues/detail?id=113

socks.py has been updated to latest.

Reply all
Reply to author
Forward
0 new messages