We will implement network changes in the near future and while we're in between installs we need to modify the proxy file, for clients in certain subnets to go direct, and the rest go through the proxy. In the meantime I'm testing with my machine, but the results are unpredictable. This is my file:
function FindProxyForURL(url, host) {
if (isInNet(dnsResolve(host), "172.20.0.0", "255.255.0.0") ||
isInNet(dnsResolve(host), "10.0.0.0", "255.0.0.0") ||
isInNet(myIpAddress(), "172.20.36.147", 255.255.255.255))
return "DIRECT";
return "PROXY X.X.X.X:9090";
}
The part that is not working is
isInNet(myIpAddress(), "172.20.36.147", 255.255.255.255
I am testing with my own IP, if I apply this file to a different system in the same subnet, but different IP, it also sends the traffic direct.
Does this function work with /24 subnet ranges only? Are there any known limitations.
What could be a different way to achieve the same result.
Thank you in advance,
Erga
I did find a typo in my proxy file, the correct line now is:
isInNet(myIpAddress(), "172.20.36.147", "255.255.255.255")
Still is not working. I tried to replace the subnet mask with a CIDR notation, no luck.
This discussion is a really good read relevent to what you're seeing:
I say its relevent because you're using the myIpAddress function which can be unreliable. You may gleen other info from that discussion though.
Corporate Headquarters
6220 America Center Drive
San Jose, CA 95002 USA