Wpad file incorrect

Hello!
My wpad File is out of the box not correct. Can someone tell me why ipfire configures it wrong out of the box?
The problem is that the rule for Internet is wrong in that file.
My File:

function FindProxyForURL(url, host)
{
if (
(isPlainHostName(host)) ||
(isInNet(host, “127.0.0.1”, “255.0.0.0”)) ||
(isInNet(host, “192.168.8.0”, “255.255.255.0”)) ||
(isInNet(host, “169.254.0.0”, “255.255.0.0”))
)
return “DIRECT”;

else

if (
(isInNet(myIpAddress(), “[Start of Local Green IP Range]”, “[End of Local Green IP Range]”))
)
return “PROXY [IPFIREsLocaleIP]:8080”;
}

… Words with [] are placeholder which i replace for security

What is wrong with the file?

In plain words:
if host is local then return “DIRECT”
elseif client is in green0 then return “PROXY :8080”

2 Likes

This would be corrected:

function FindProxyForURL(url, host)
{
if (
     (isPlainHostName(host)) ||
     (isInNet(host, "127.0.0.1", "255.0.0.0")) ||
     (isInNet(host, "192.168.8.0", "255.255.255.0")) ||
     (isInNet(host, "169.254.0.0", "255.255.0.0"))
   )
     return "DIRECT";

 else


     return "PROXY [IPFIREsLocaleIP]:8080";
}

… Words with [ ] are placeholder which i replace for security

Could this be fixed out of the box in the product?

No, because there is nothing to fix.

Your option would mean whether your ip was in green or blue or whatever it would be directed to the proxy.

If blue is not enabled in the proxy then the wpad file should not direct it to the proxy. That is why the selection boxes are there in the proxy to enable proxy for green and/or blue. That is what the wpad file currently correctly reflects.

2 Likes

Ah, seems to work now with current version :slight_smile: