Home | History | Annotate | Download | only in js-unittest
      1 // PAC script which uses isInNet on both IP addresses and hosts, and calls
      2 // isResolvable().
      3 
      4 function FindProxyForURL(url, host) {
      5   var my_ip = myIpAddress();
      6 
      7   if (isInNet(my_ip, "172.16.0.0", "255.248.0.0")) {
      8     return "PROXY a:80";
      9   }
     10 
     11   if (url.substring(0, 6) != "https:" &&
     12       isInNet(host, "10.0.0.0", "255.0.0.0")) {
     13     return "PROXY b:80";
     14   }
     15 
     16   if (dnsDomainIs(host, "foo.bar.baz.com") || !isResolvable(host)) {
     17     return "PROXY c:100";
     18   }
     19 
     20   return "DIRECT";
     21 }
     22