Comment 2 for bug 209691

Revision history for this message
Colin Watson (cjwatson) wrote :

Getting hold of the wpad.dat file is easy enough (a tweak to our dhclient configuration in netcfg to ask for the DHCP option, and some code in choose-mirror that, in the event a proxy is not preseeded, looks at that DHCP option or failing that does a DNS lookup, and then fetches the relevant file).

The interesting quirk here, though, is that WPAD works by delivering a JavaScript file (http://en.wikipedia.org/wiki/Proxy_auto-config) to the client that it's supposed to use to dynamically determine the proxy. Either apt would have to honour this or we'd have to parse it in d-i to work out what to do. In the latter case we would need to decide what should happen in the event that wpad.dat says that (e.g.) archive.ubuntu.com should be proxied but security.ubuntu.com should go direct.

It seems that doing this properly would rely on having apt parse this file. Embedding a full JavaScript interpreter in apt seems ... overkill, though. A bit of web-searching turned up http://code.google.com/p/pacparser/, although further investigation shows that that depends on SpiderMonkey. Would this be a showstopper for use in apt?

Getting this right would be awfully nice for seamless non-network-specific proxy configuration that goes beyond just the web browser.