HypeTutorials / google-api-python-client

Automatically exported from code.google.com/p/google-api-python-client
Other
0 stars 0 forks source link

GoogleConnect method doesn't work with a proxy #91

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1.Configuring httplib2 to use a proxy (socks5 or HTTP) with Socksipy-branch 
module

httpProxy = httplib2.Http(proxy_info = 
httplib2.ProxyInfo(socks.PROXY_TYPE_SOCKS5, 'localhost', 1080))

2.Building service :
service = build(serviceName='calendar', version='v3', http=httpProxy,
        developerKey=developerKey)

What is the expected output? What do you see instead?

Traceback (most recent call last):
  File "GoogleCal.py", line 343, in <module>
    main()
  File "GoogleCal.py", line 270, in main
    service = googleConnect(client_id,client_secret,developerKey,user_agent,proxy_adress,proxy_port,proxy_login,proxy_pwd)
  File "GoogleCal.py", line 59, in googleConnect
    credentials = run(FLOW, storage)
  File "C:\pythonPort\App\lib\site-packages\google_api_python_client-1.0beta7-py2.7.egg\oauth2client\tools.py", line 146, in
    credential = flow.step2_exchange(code)
  File "C:\pythonPort\App\lib\site-packages\google_api_python_client-1.0beta7-py2.7.egg\oauth2client\client.py", line 881, in
    headers=headers)
  File "C:\pythonPort\App\lib\site-packages\httplib2-0.7.2-py2.7.egg\httplib2\__init__.py", line 1560, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "C:\pythonPort\App\lib\site-packages\httplib2-0.7.2-py2.7.egg\httplib2\__init__.py", line 1310, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "C:\pythonPort\App\lib\site-packages\httplib2-0.7.2-py2.7.egg\httplib2\__init__.py", line 1252, in _conn_request
    raise ServerNotFoundError("Unable to find the server at %s" % conn.host)
httplib2.ServerNotFoundError: Unable to find the server at accounts.google.com

What version of the product are you using? On what operating system?

httplib2
google-api-python-client latest version

Please provide any additional information below.

Proxy seems to work with any request, but Google Connect request directly and 
not via the proxy

Original issue reported on code.google.com by pschi...@gmail.com on 2 Feb 2012 at 4:30

GoogleCodeExporter commented 8 years ago
oauth2client.tools.run() should take an optional http object and use that for 
all requests if it is supplied.

Original comment by jcgregorio@google.com on 3 Feb 2012 at 12:19

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
CL out for review http://codereview.appspot.com/5646045/

Original comment by jcgregorio@google.com on 7 Feb 2012 at 7:29

GoogleCodeExporter commented 8 years ago
Patch applied, and it seems to work.

Tryed with a SOCKS 5 proxy. I didn't try with an http proxy.

Original comment by pschi...@gmail.com on 7 Feb 2012 at 8:11

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 10132e90f8bf.

Original comment by jcgregorio@google.com on 7 Feb 2012 at 8:42