Sha256: b46603e6b06c80dce2595bcb6a5ce48a3cd4806d3fc273fbee7aacd22ac3ea3c

Contents?: true

Size: 781 Bytes

Versions: 14

Compression:

Stored size: 781 Bytes

Contents

// Main
function FindProxyForURL(url, host) {

  if ( reach_via_socks(url, host, dnsResolve(host))) {
    return socks_proxy();
  }

  if ( reach_directly(url, host, dnsResolve(host))) {
    return no_proxy();
  }

  return default_proxy();
}


// Helper

function default_proxy() {
  return "PROXY 127.0.0.1:3128";
}

function no_proxy() {
  return "DIRECT";
}

function socks_proxy() {
  return "SOCKS 127.0.0.1:1080";
}

function reach_directly(url, host, host_ip) {

  return isPlainHostName(host) ||
    host == "localhost" ||
    shExpMatch(host, "localhost.*") ||
    host == "127.0.0.1" ||
    dnsDomainIs ( host , ".example.org") ||
    dnsDomainIs ( host , ".in.example.org");
}

function reach_via_socks(url, host, host_ip) {
    return host == "server.example.org");
}

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
local_pac-0.10.2 files/examples/proxy-complex.pac.example
local_pac-0.10.1 files/examples/proxy-complex.pac.example
local_pac-0.10.0 files/examples/proxy-complex.pac.example
local_pac-0.9.0 files/examples/proxy-complex.pac.example
local_pac-0.7.0 files/examples/proxy-complex.pac.example
local_pac-0.6.3 files/examples/proxy-complex.pac.example
local_pac-0.6.2 files/examples/proxy-complex.pac.example
local_pac-0.6.1 files/examples/proxy-complex.pac.example
local_pac-0.5.0 files/examples/proxy-complex.pac.example
local_pac-0.4.0 files/examples/proxy-complex.pac.example
local_pac-0.3.0 files/examples/proxy-complex.pac.example
local_pac-0.2.3 files/examples/proxy-complex.pac.example
local_pac-0.2.2 files/examples/proxy-complex.pac.example
local_pac-0.2.1 files/examples/proxy-complex.pac.example