zhangqd / chromiumembedded

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

Add http proxy support for automate.py #796

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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_COMPATIBILI
TY.txt?r=924
Traceback (most recent call last):
  File "F:\cef_test\automate\automate.py", line 136, in <module>
    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)  

Original issue reported on code.google.com by Zhaojun....@gmail.com on 22 Nov 2012 at 3:02

GoogleCodeExporter commented 9 years ago
CEF is transitioning from Google Code to Bitbucket project hosting. If you 
would like to continue receiving notifications on this issue please add 
yourself as a Watcher at the new location: 
https://bitbucket.org/chromiumembedded/cef/issue/796

Original comment by magreenb...@gmail.com on 14 Mar 2015 at 3:23