chromiumembedded / cef

Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.
https://bitbucket.org/chromiumembedded/cef/
Other
3.13k stars 450 forks source link

Add http proxy support for automate.py #796

Open magreenblatt opened 11 years ago

magreenblatt commented 11 years ago

Original report by Anonymous.


Original issue 796 created by Zhaojun.Meng on 2012-11-22T03:02:11.000Z:

What steps will reproduce the problem?

  1. Run automate.py on a machine must use proxy to access internet,

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

The following error message appears.
Failed to read URL and revision information from http://chromiumembedded.googlecode.com/svn/trunk/cef3/CHROMIUM\_BUILD\_COMPATIBILITY.txt?r=924
Traceback (most recent call last):
File "F:\cef_test\automate\automate.py", line 136, in
handle = urllib.urlopen(compat_url)
File "C:\Python27\lib\urllib.py", line 84, in urlopen
return opener.open(url)
File "C:\Python27\lib\urllib.py", line 205, in open
return getattr(self, name)(url)
File "C:\Python27\lib\urllib.py", line 342, in open_http
h.endheaders(data)
File "C:\Python27\lib\httplib.py", line 951, in endheaders
self._send_output(message_body)
File "C:\Python27\lib\httplib.py", line 811, in _send_output
self.send(msg)
File "C:\Python27\lib\httplib.py", line 773, in send
self.connect()
File "C:\Python27\lib\httplib.py", line 754, in connect
self.timeout, self.source_address)
File "C:\Python27\lib\socket.py", line 571, in create_connection
raise err
IOError: [Errno socket error] [Errno 10060]

What version of the product are you using? On what operating system?
Cef3 r919, Windows7.

Please provide any additional information below.

In chromium\src\native_client\build\http_download.py, it has http proxy support like this:

if os.environ.get('http_proxy'):
proxy = os.environ.get('http_proxy')
proxy_handler = urllib2.ProxyHandler({
'http': proxy,
'https': proxy})
opener = urllib2.build_opener(proxy_handler)
else:
opener = urllib2.build_opener()

Maybe we should read 'http_proxy' settings too, just like:
if os.environ.get('http_proxy'):
proxies = {'http': os.environ.get('http_proxy')}
handle = urllib.urlopen(compat_url, proxies=proxies)
else:
handle = urllib.urlopen(compat_url)

magreenblatt commented 7 years ago