You need to include the lines of code similar to the following in your WPAD file while making the necessary alterations for your own network so it is applicable to your network.

if (isInNet(resolved_ip, "10.0.0.0", "255.0.0.0") ||
isInNet(resolved_ip, "172.16.0.0", "255.240.0.0") ||
isInNet(resolved_ip, "192.168.0.0", "255.255.0.0") ||
isInNet(resolved_ip, "127.0.0.0", "255.255.255.0")) {
return "DIRECT";
}