Friday, April 8, 2016

Simple WPAD script for direct connection to anything local

Below is a simple wpad script to let users have direct connection to anything local and the rest through proxy. You can continue to add statements but remember to add the corresponding brackets and the start and end.


isPlainHostName(host) - the destination hostname. Any plain hostname (without FQDN) will be going direct

isInNet(myIpAddress() - the source address. This may be a local network where you do not want the users to use the proxy.

isInNet(host) - the destination address. The three shown are all the private address
function FindProxyForURL(url, host)
if (((((isPlainHostName(host) ||
dnsDomainIs(host, "") ||
isInNet(myIpAddress(), "x.x.x.x", "m.m.m.m") ||
isInNet(host, "", "") ||
isInNet(host, "", "") ||
isInNet(host, "", ""))))))
return "DIRECT";
else return "PROXY your-proxy-server-ip:3128";

No comments: