function FindProxyForURL(url, host) {
host = host.toLowerCase();
url = url.toLowerCase();
// If the hostname matches, send direct.
if (dnsDomainIs(host, “.apple.com”) || host == “apple.com”) ||
(dnsDomainIs(host, “.skype.com”) || host == “skype.com”) ||
(dnsDomainIs(host, “.office365.com”) || host == “office365.com”) ||
(dnsDomainIs(host, “.azure.com”) || host == “azure.com”) ||
(dnsDomainIs(host, “.altium.com”) || host == “altium.com”))
{
return “DIRECT”;
}
// If the hostname matches, send direct.
if ( shExpMatch(url, “greenhulk:8080/“) ) { return “DIRECT”; }
if ( shExpMatch(url, “greenhulk:8082/“) ) { return “DIRECT”; }
if ( shExpMatch(url, “greenhulk:8081/“) ) { return “DIRECT”; }
if ( shExpMatch(url, “greenhulk:8083/“) ) { return “DIRECT”; }
var allowedUrls = new Array(
“office365“,
“gov.il“,
“mrclab.com“,
“sharepoint“,
“cloudapp“,
“outlook.cn“,
“microsoftonline“,
“netflix“,
);
for (index in allowedUrls)
{
if (shExpMatch(url, allowedUrls[index]))
{
return “DIRECT”;
}
}
// If its internal lan, send direct
if (isPlainHostName(host))
{
return “DIRECT”;
}
else
return “PROXY Servername.Domain.com:8080; DIRECT”;
}