Você já recebeu uma resposta?
Tente algo assim:
function FindProxyForURL(url, host) {
// Proxy variables
var PROXY1 = "PROXY 172.16.51.254:8080"
var PROXY2 = "PROXY 172.16.8.254:8080"
var BLACKHOLE = "PROXY 127.0.0.1:8080" //Deny Internet access by using localhost as proxy
var CLIENTIP = myIpAddress();
var resolved_ip = dnsResolve(host);
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.0.0.0")
)
return "DIRECT";
if (
isInNet(CLIENTIP,"172.16.51.0","255.255.255.0") //If CLIENTIP falls in range
)
return PROXY1; //return specific proxy
if (
isInNet(CLIENTIP,"172.16.8.0","255.255.255.0")//If CLIENTIP falls in range
)
return PROXY2; //return specific proxy
return BLACKHOLE; //If all of the above fails return blackhole proxy, e.g. deny internet access
}