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