Comment 2 for bug 22705

Revision history for this message
Jens (jens-launchpad-net) wrote :

"Automatic" proxy configuration, AFAIK, requires you to download a Javascript file via http://wpad/wpad.dat (Web Proxy Auto Discovery, or something) and then interpret this file as a Javascript file.

Ubuntu contains libjs0, which is a complete Javascript library implementation. The functions that can be used in wpad.dat and proxy.pac style scripts are listed here: http://wp.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html

So, it should be possible to parse the automatic proxy config script via a javascript command line interpreter.

HOWEVER: since this is a static setup and no re-evaluated for each URL (the browsers evaluate the FindProxyForURL() function for each request they make!), we need to simplyfy things a bit. I propse the following:

Either, just grep for the first "return 'PROXY foo.bar:1234'; " and use this.
Or, implement some sane defaults for PAC functions listed above, and evaluate the PAC file using ngs-js.

Since most autoconfig proxy scripts contain quite difficult evaluations (ours here is over 100 lines, listing all kinds of different proxies for HTTP, FTP, RTSP, SOCKS, etc etc etc) the alternative would be to offer setting a proxy _directly_ within the update application, or at least point to the proxy setting if no connection can be made to the outside.

Jens