|
Question : Help with wpad script
|
|
I have written a wpad.dat script for Proxy settings on my network. The script is working fine with directing traffic through a proxy for internet traffic and directly for intranet traffic. I'm trying to also have the wpad scrpit detect if the client is connected over vpn and if so, route internet traffic Direct, instead of through the proxy. Below is what I have currently. Our VPN IP pool is 172.17.1.x
function FindProxyForURL(url, host) { if (isPlainHostName(host)) return "DIRECT"; else if (dnsDomainIs(host, "mydomain.com")) return "DIRECT"; else if (dnsDomainIs(host, "localhost")) return "DIRECT"; else if (dnsDomainIs(host, "bluespringsgov.com") || isInNet(host, "127.0.0.1", "255.255.0.0") || isInNet(host, "10.0.0.0", "255.0.0.0")) return "DIRECT"; else return "PROXY proxy.mydomain.com:8080"; }
|
Answer : Help with wpad script
|
|
ooops posted while editing should have been:
function FindProxyForURL(url, host) { if (!(isResolvable(host)) return "DIRECT";
var hostip=dnsResolve(host); if (isPlainHostName(host) || dnsDomainIs(host, "mydomain.com") || dnsDomainIs(host, "localhost") || dnsDomainIs(host, "bluespringsgov.com") || isInNet(hostip, "127.0.0.1", "255.255.0.0") || isInNet(hostip, "10.0.0.0", "255.0.0.0") || isInNet(hostip, "172.17.1.0", "255.255.255.0") ) return "DIRECT"; else return "PROXY proxy.mydomain.com:8080"; }
I hoep this takes you close enough ...
SnowFlake
|
|
|
|