Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Httplib2 ignored global proxy setting #88

Open
wally-yu opened this issue Feb 12, 2018 · 5 comments
Open

Httplib2 ignored global proxy setting #88

wally-yu opened this issue Feb 12, 2018 · 5 comments

Comments

@wally-yu
Copy link

Dear Httplib2 team,

this issue puzzled me a while, you know somehow, some place in the world have to use proxy to connect to google and google API. I use "Shadowsocks", lol.

The problem is when I set Shadowsocks to global mode, means all my local traffic will go through Shadowsocks proxy.

Weird thing is when I use "requests" it works fine, see blow code:
import requests
print requests.get("http://www.google.com").content
print 'this works fine'

However I tried to use httplib2, I got error 'httplib.ResponseNotReady':
import httplib2
h = httplib2.Http()
(resp_headers, content) = h.request("http://www.google.com", "GET")
print 'this will throw httplib.ResponseNotReady error'

if this would be useful to you, here are the callstack:
File "D:\virtualenv\env\lib\site-packages\httplib2\__init__.py", line 1659, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "D:\virtualenv\env\lib\site-packages\httplib2\__init__.py", line 1399, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "D:\virtualenv\env\lib\site-packages\httplib2\__init__.py", line 1355, in _conn_request
response = conn.getresponse()
File "C:\Python27\Lib\httplib.py", line 1108, in getresponse
raise ResponseNotReady()
httplib.ResponseNotReady

Could you please suggest in my situation, how I can use httplib2 and access to Google Analytics API?
Thanks in advance.

Wally

@temoto
Copy link
Member

temoto commented Feb 12, 2018

I don't understand how "shadowsocks global mode" is supposed to affect httplib2.

Most likely, duplicate of #53 If that is case, your best option right now is to use Python3.

@wally-yu
Copy link
Author

wally-yu commented Feb 12, 2018

Dear Sergey,

i don't know how shadowsocks implemented, but once i made the setting, everything from my machine will go through it (including all browsers).

I tried python3.6, that didn't solve the problem, I got error mesage:
"TimeoutError: [WinError 10060]"

do you have any other suggestions?

@temoto
Copy link
Member

temoto commented Feb 12, 2018

Okay that's duplicate of #68

You need to know which proxy technology you want to use. For example, describe how you would configure any browser manually to use this proxy.

@temoto
Copy link
Member

temoto commented Mar 21, 2018

@wally-yu please try to update httplib2, new version should work with any proxy.

@dpocock
Copy link

dpocock commented Feb 29, 2020

please also see this fix
#157

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants