eshad / httplib2

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

Proxy socks not working #199

Closed GoogleCodeExporter closed 9 years ago

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

import httplib2
import socks

http = httplib2.Http(proxy_info = 
httplib2.ProxyInfo(httplib2.socks.PROXY_TYPE_SOCKS5, proxy_adr, 
int(proxy_port)))
requested_url = "http://www.google.com"
http.request(requested_url)

What is the expected output? 
Requesting success

What do you see instead?
Proxy doesn't seem to work (see errors below) :

Traceback (most recent call last):
  File "/Users/user/Documents/Aptana Studio 3 Workspace/GoogleCal/GoogleCal.py", line 289, in <module>
    main()
  File "/Users/user/Documents/Aptana Studio 3 Workspace/GoogleCal/GoogleCal.py", line 252, in main
    service = googleConnect(client_id,client_secret,developerKey,user_agent,proxy_adress,proxy_port,proxy_login,proxy_pwd)
  File "/Users/user/Documents/Aptana Studio 3 Workspace/GoogleCal/GoogleCal.py", line 82, in googleConnect
    developerKey=developerKey)
  File "/Library/Python/2.7/site-packages/google_api_python_client-1.0beta7-py2.7.egg/apiclient/discovery.py", line 176, in build
    resp, content = http.request(requested_url)
  File "/Library/Python/2.7/site-packages/google_api_python_client-1.0beta7-py2.7.egg/oauth2client/client.py", line 514, in new_request
    redirections, connection_type)
  File "/Library/Python/2.7/site-packages/httplib2-0.7.2-py2.7.egg/httplib2/__init__.py", line 1445, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/Library/Python/2.7/site-packages/httplib2-0.7.2-py2.7.egg/httplib2/__init__.py", line 1197, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/Library/Python/2.7/site-packages/httplib2-0.7.2-py2.7.egg/httplib2/__init__.py", line 1139, in _conn_request
    raise ServerNotFoundError("Unable to find the server at %s" % conn.host)
httplib2.ServerNotFoundError: Unable to find the server at www.google.com

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

Python 2.7
Mac Os X 10.7

Please provide any additional information below.
Doesn't work either with a proxy HTTP

Original issue reported on code.google.com by pschi...@gmail.com on 1 Feb 2012 at 8:02

GoogleCodeExporter commented 9 years ago
Problem seems to be in the class 
HTTPSConnectionWithTimeout(httplib.HTTPSConnection) in _init_.py file

Proxy doesn't seem to work for SSL connections

Original comment by pschi...@gmail.com on 2 Feb 2012 at 6:31

GoogleCodeExporter commented 9 years ago
Here is a patch. This patch is an update of the patch from the issue 113.
https://code.google.com/p/httplib2/issues/detail?id=113

It applies the same changes but this time to the HTTPSConnectionWithTimeout 
class.

Original comment by pschi...@gmail.com on 2 Feb 2012 at 8:01

Attachments:

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 6a56df183ec1.

Original comment by joe.gregorio@gmail.com on 17 Apr 2012 at 8:32