Firefox Windows 7 and Linux proxy.pac

Had a problem today with Firefox on Windows 7 and Firefox on Linux. Upon reading our proxy.pac (wpad) file the if statements were not working:

if(isInNet(myIpAddress(), “123.111.123.0″,”255.255.254.0″))

According to this post on Mozilla the problem is due to how FF/Win7 reports the ipv6 address, rather than the ipv4 version. So the solution was to add the CIDR version too e.g.

isInNet(myIpAddress(), “123.111.123.0″, “255.255.254.0″) ||
isInNet(myIpAddress(), “123.111.123.0″, “/23″) || 

Order has been restored!



3 Comments to “Firefox Windows 7 and Linux proxy.pac”

  • I tried this solution but didn’t work for me.
    The relevant code in my .pac script:

    function FindProxyForURL(url, host) {
    var proxy_a = “PROXY server1.lab.local:3128″;
    var proxy_b = “PROXY server2.lab.local:3128″;
    var proxy_no = “DIRECT”;

    if (isResolvable(host)) { ip = dnsResolve(host); }
    if (isInNet(ip, “127.0.0.1″, “255.255.255.0″)) { return proxy_no; }
    if (isInNet(ip, “10.0.0.0″, “255.0.0.0″)) { return proxy_no; }

    myip = myIpAddress();
    if (isInNet(myip, “172.16.1.0″, “255.255.255.0″) || (isInNet(myip, “172.16.1.0″, “/24″)) { return proxy_a; }
    if (isInNet(myip, “172.16.2.0″, “255.255.255.0″)) { return proxy_b; }
    }

  • Try network.dns.disableIPv6 = True in Fireforx config (about:config in URL)

  • Thanks works perfectly.

    Windows 7 + Firefox / IE9

Post comment