I have a squid + diladele proxy box in my network. I have setup a PAC file that should do the following:
1)If the ip address of the client belongs to the current network (192.168.0.0/24) and tries to access a resource outside the network use the proxy. 2)If the client is trying to access an internal resource, give direct access and bypass proxy
Here is what I wrote so far
// If the IP address of the local machine is within a defined
// subnet, send to a specific proxy.
if (isInNet(myIpAddress(), "192.168.0.0", "255.255.255.0"))
return "PROXY 192.168.0.253:3128";
// If the requested website is hosted within the internal network, send direct.
if (isPlainHostName(host) ||
shExpMatch(host, "*local") ||
isInNet(dnsResolve(host), "192.168.0.0","255.255.0.0") ||
isInNet(dnsResolve(host), "127.0.0.1", "255.255.255.255")||
shExpMatch(host,"localhost"))
return "DIRECT";
// DEFAULT RULE: All other traffic, use below proxies, in fail-over order.
return "DIRECT";
Everything works perfectly, however when I try to access a resource on localhost
( I have a lamp stack on my device ) for some reason I get redirected to my proxy web interface (192.168.0.253).
What am I doing wrong?