Vollständige Proxy.pac

Hier ein Beispiel für eine vollständige Proxy.pac. Einfach den Inhalt in eine Datei kopieren und auf einem Webserver bereitstellen. Sinnvoll nur dort abzuspeichern wo nur die Clients ran kommen für die es auch gedacht ist.

 

function FindProxyForURL(url, host)
{
/* Don't proxy Windows Update */
if ((host == "download.microsoft.com") ||
(host == "ntservicepack.microsoft.com") ||
(host == "wustat.windows.com") ||
(host == "windowsupdate.microsoft.com") ||
(dnsDomainIs(host, ".windowsupdate.microsoft.com")) ||
(host == "update.microsoft.com") ||
(dnsDomainIs(host, ".update.microsoft.com")) ||
(dnsDomainIs(host, ".windowsupdate.com")))
{
return 'DIRECT';
}

if (isResolvable(host))
{
var hostIP = dnsResolve(host);

/* Don't proxy non-routable lan-addresses */
isInNet(hostIP, '10.0.0.0', '255.0.0.0') ||
isInNet(hostIP, '127.0.0.0', '255.0.0.0') ||
isInNet(hostIP, '172.16.0.0', '255.240.0.0') ||
isInNet(hostIP, '192.168.0.0', '255.255.0.0'))
{
return 'DIRECT';
}

/* Don't proxy local addresses.*/
if (false)
{
return 'DIRECT';
}
}

if (url.substring(0, 5) == 'http:' ||
url.substring(0, 6) == 'https:' ||
url.substring(0, 4) == 'ftp:')
{
return 'PROXY 192.168.5.9:3128';
}

return 'DIRECT';
}