This is example, if my server have 3 NIC :
-NIC 1 = external (DSL modem)
-NIC 2 = internal 192.168.0.1 (gateway for office)
-NIC 2 = internal 192.168.1.1 or 10.0.0.1 (gateway for others)
so in my DHCP service (DHCP Settings) it will have two range of ip address
so how to configure wpad.dat for automatically served to two different gateway in two different ip range correctly?
here example I try edit from wpad.template, can I used this?
if cannot, what is the correct setting i need write into wpad.dat
- Code: Select all
function FindProxyForURL(url, host)
{
if ((url.substring(0, 5) == "http:") ||
(url.substring(0, 4) == "ftp:") ||
(url.substring(0, 6) == "https:"))
{
return "PROXY 192.168.0.1:80;DIRECT";
}
else if (isInNet(myIpAddress(),"192.168.1.0","255.255.255.0"))
{
return "PROXY 192.168.1.1:80;DIRECT";
}
}
other example i get from internet
- Code: Select all
function FindProxyForURL(url, host)
{
if (isPlainHostName(host) ||
isInNet(host, "10.0.0.0", "255.0.0.0") ||
isInNet(host, "172.16.0.0", "255.255.224.0") ||
isInNet(host, "192.168.0.0", "255.255.0.0") ||
isInNet(host, "127.0.0.0", "255.0.0.0"))
return "DIRECT";
if ((url.substring(0, 5) == "http:") ||
(url.substring(0, 4) == "ftp:") ||
(url.substring(0, 6) == "https:"))
return "PROXY 192.168.0.1:80;DIRECT";
if (isInNet(myIpAddress(),"192.160.1.0","255.255.255.0"))
return "PROXY 192.168.1.1:80;DIRECT";
} ;
thanks :)