getlantern/lantern — pull request #1185 by pekrr1e (2013-11-29 02:13:41+00:00)
Title: #1147 Allow Lantern to use another local(system) proxy setting

Users who want to use local proxy settings need modify proxy_off.pac
with their customization.
Lantern may use this local proxy setting to bootstrap or proxy service.
Remember: Users may need use UI to update running .pac through changing
Lantern proxy sites.
And user defined proxy_off.pac can be this,
function FindProxyForURL(url, host) {
return "PROXY 172.1.2.3:8080; DIRECT";
}
or like this complicate one,
var localDomains = new Array();
var j=0;
localDomains[j++] = "compay.com";
localDomains[j++] = "compay.net";
localDomains[j++] = "172.*";
for(j in localDomains) {
localDomains[j] = localDomains[j].split(/./).join("\.");
}
var localDomainsRegx = new RegExp("(" + localDomains.join("|") + ")$",
"i");
function FindProxyForURL(url, host) {
if( host == "localhost" ||
host == "127.0.0.1"||
localDomainsRegx.exec(host)) {
return "DIRECT";
}
return "PROXY 172.1.2.3:8080; DIRECT";
}