You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pac-resolver-gh-3.expected.js 625B

1234567891011121314151617181920212223
  1. function* FindProxyForURL(url, host) {
  2. if (yield isHostInAnySubnet(host, [
  3. '10.1.2.0',
  4. '10.1.3.0'
  5. ], '255.255.255.0')) {
  6. return 'HTTPS proxy.example.com';
  7. }
  8. if (yield isHostInAnySubnet(host, [
  9. '10.2.2.0',
  10. '10.2.3.0'
  11. ], '255.255.255.0')) {
  12. return 'HTTPS proxy.example.com';
  13. }
  14. return 'DIRECT';
  15. }
  16. function* isHostInAnySubnet(host, subnets, mask) {
  17. var subnets_length = subnets.length;
  18. for (i = 0; i < subnets_length; i++) {
  19. if (yield isInNet(host, subnets[i], mask)) {
  20. return true;
  21. }
  22. }
  23. }