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

%3CLINGO-SUB%20id%3D%22lingo-sub-2082543%22%20slang%3D%22en-US%22%3EWpad%2FPac%20file%20section%20ignored%20in%20Edge%2FIE%2FChrome%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2082543%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EHi%20guys%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20have%20a%20situation%20whereby%20we%20have%20a%20WPAD.dat%20file%20that%20is%20being%20used%20within%20our%20estate.%20This%20script%20below%20is%20saved%20as%20a%20'wpad.dat'%20file.%20I%20obtain%20an%20IP%20address%20of%2010.210.50.x%20when%20I%20connect%20to%20the%20VPN%20to%20a%20firewall%2C%20which%20does%20indeed%20have%20split%20tunneling%20setup%20and%20does%20work.%20However%2C%20every%20single%20time%2C%20my%20browsers%20(edge%2C%20chrome)%20pick%20up%20the%20Wpad%20file%2C%20rather%20than%20get%20instructions%20to%20break%20out%20'DIRECT'%2C%20it%20ignores%20this%20and%20reads%20the%20proxy%20in%20the%20final%20line%20and%20goes%20out%20of%20the%20PROXY%2C%20not%20the%20line%20which%20reads%20my%20IP%20range.%20Same%20with%20my%20colleagues.%26nbsp%3B%20I've%20read%20a%20lot%20about%20it%20being%20to%20do%20with%20the%20'myIpAddress'%20function%20and%20apparently%20the%20internal%20IP%20address%20of%20the%20first%20entry%20is%20returned%20from%20the%20list%20of%20IP%20addresses%20that%20are%20obtained%20in%20the%20getaddrinfo%20function%20of%20Winsock%3F%26nbsp%3B%20My%20Edge%20version%20is%26nbsp%3B87.0.664.75.%26nbsp%3B%26nbsp%3BThis%20is%20what%20I'm%20trying%20below.%20Any%20ideas%20or%20help%20would%20be%20so%20so%20helpful.%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Efunction%20FindProxyForURL(url%2C%20host)%20%7B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%2F%2Furl%20%3D%20url.toLowerCase()%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%2F%2Fhost%20%3D%20host.toLowerCase()%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%2F%2F%20If%20the%20hostname%20matches%2C%20send%20direct.%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3Eif%20(dnsDomainIs(host%2C%20%22.contoso.co.uk%22)%20%7C%7C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20shExpMatch(host%2C%20%22(*.contoso.co.uk%7Ccontoso.local)%22))%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20return%20%22DIRECT%22%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%2F%2F%20If%20the%20requested%20website%20is%20hosted%20within%20the%20internal%20network%2C%20send%20direct.%20%26nbsp%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3Eif%20(isPlainHostName(host)%20%7C%7C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20shExpMatch(host%2C%20%22*.local%22)%20%7C%7C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20isInNet(dnsResolve(host)%2C%20%2210.0.0.0%22%2C%20%22255.0.0.0%22)%20%7C%7C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20isInNet(dnsResolve(host)%2C%20%22172.16.0.0%22%2C%20%26nbsp%3B%22255.240.0.0%22)%20%7C%7C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20isInNet(dnsResolve(host)%2C%20%22192.168.0.0%22%2C%20%26nbsp%3B%22255.255.0.0%22)%20%7C%7C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20isInNet(dnsResolve(host)%2C%20%22173.37.0.0%22%2C%20%26nbsp%3B%22255.255.0.0%22)%20%7C%7C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20isInNet(dnsResolve(host)%2C%20%22127.0.0.0%22%2C%20%22255.255.255.0%22))%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20return%20%22DIRECT%22%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Eif%20(isInNetEx%20(myIpAddress()%2C%20%2210.201.50.0%22%2C%20%22255.255.255.0%22))%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3Ereturn%20%22PROXY%2010.208.5.254%3A3128%3B%20DIRECT%22%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Ereturn%20%22PROXY%2010.215.0.230%3A8080%3B%20DIRECT%22%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EThanks%20for%20helping%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3EYashy%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Regular Visitor

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