Code:
function FindProxyForURL(url, host)
{
// Variable strings to return
var proxy_yes = "PROXY 172.16.0.197:8000";
var proxy_no = "DIRECT";
// Execptions for direct connection
if (shExpMatch(url, "http://printers:9191/*")) { return proxy_no; }
if (shExpMatch(url, "https://printers:9191/*")) { return proxy_no; }
if (shExpMatch(url, "http://zimbra/*")) { return proxy_no; }
if (shExpMatch(url, "https://zimbra/*")) { return proxy_no; }
if (shExpMatch(url, "http://server1*")) { return proxy_no; }
if (shExpMatch(url, "https://server1*")) { return proxy_no; }
// Proxy if PC is on local LAN
if (isInNet(myIpAddress(), "172.16.0.0", "255.255.0.0"))
return "PROXY 172.16.0.197:8000";
// Below for Firefox bug when running on Linux by checking localhost
else if (isInNet(myIpAddress(), "127.0.0.0", "255.0.0.0"))
return "PROXY 172.16.0.197:8000";
// Everything else to go direct
else
return "DIRECT";
}