Wpad/Pac file section ignored in Edge/IE/Chrome

Copper Contributor

Hi guys

 

I have a situation whereby we have a WPAD.dat file that is being used within our estate. This script below is saved as a 'wpad.dat' file. I obtain an IP address of 10.210.50.x when I connect to the VPN to a firewall, which does indeed have split tunneling setup and does work. However, every single time, my browsers (edge, chrome) pick up the Wpad file, rather than get instructions to break out 'DIRECT', it ignores this and reads the proxy in the final line and goes out of the PROXY, not the line which reads my IP range. Same with my colleagues.  I've read a lot about it being to do with the 'myIpAddress' function and apparently the internal IP address of the first entry is returned from the list of IP addresses that are obtained in the getaddrinfo function of Winsock?  My Edge version is 87.0.664.75.  This is what I'm trying below. Any ideas or help would be so so helpful.

function FindProxyForURL(url, host) {
//url = url.toLowerCase();
//host = host.toLowerCase();

// If the hostname matches, send direct.
if (dnsDomainIs(host, ".contoso.co.uk") ||
        shExpMatch(host, "(*.contoso.co.uk|contoso.local)"))
        return "DIRECT";


// If the requested website is hosted within the internal network, send direct.  
   
if (isPlainHostName(host) ||
    shExpMatch(host, "*.local") ||
    isInNet(dnsResolve(host), "10.0.0.0", "255.0.0.0") ||
    isInNet(dnsResolve(host), "172.16.0.0",  "255.240.0.0") ||
    isInNet(dnsResolve(host), "192.168.0.0",  "255.255.0.0") ||
    isInNet(dnsResolve(host), "173.37.0.0",  "255.255.0.0") ||
    isInNet(dnsResolve(host), "127.0.0.0", "255.255.255.0"))
    return "DIRECT";

if (isInNetEx (myIpAddress(), "10.201.50.0", "255.255.255.0"))
return "PROXY 10.208.5.254:3128; DIRECT";

return "PROXY 10.215.0.230:8080; DIRECT";

}

Thanks for helping
Yashy

0 Replies