Talk:Proxy auto-config

PAD file can be a local file.
Instructions from here: http://nscsysop.hypermart.net/proxypac.html

Autoconfigure the Proxy Settings from a Local Copy of the PROXY.PAC File (IE or Netscape)

In this method, useful for laptops that travel on and off your LAN, you copy the file to some local directory, and point to it.

1. Copy the PROXY.PAC file to the C:\WINDOWS directory, or other directory of your choice. 2. In the browser proxy settings, configure the Automatic Proxy Configuration (Netscape) or Use Automatic Configuration Script (IE) URL to:

Netscape, use: file:///c|/windows/proxy.pac

Internet Explorer, use: file://c:/windows/

In Netscape, click on the Reload button.


 * However, this removes the ability to change the proxy settings on the fly.
 * Axel Eble 15:46, 21 June 2006 (UTC)

Only newer versions of Internet Explorer can use a local PAC file. 90.49.223.248 (talk) 17:31, 1 February 2008 (UTC) Ninho

Efficient direct intranet configuration
From the Google Accelerator project: var proxy = "PROXY proxy.example.com:3128"; function FindProxyForURL (url, host) { if (host == "localhost" || host == "127.0.0.1" ||      private_re.test(host) ||       isPlainHostName (host) ||       url.substring(0, 6) == "https:"      ) return "DIRECT"; return proxy + "; DIRECT"; } /* quick version to avoid DNS resolving, performs a regular expression to * detect RFC 1918, RFC 1112, 239/24 bogon, and class E experimental ranges. */ var private_re = new RegExp("^((0\\.0\\.0\\.0)|(127\\.\\d+\\.\\d+\\.\\d+)|(10\\.\\d+\\.\\d+\\.\\d+)|(172\\.(1[6789]|2[0-9]|3[01])\\.\\d+\\.\\d+)|(169\\.254\\.\\d+\\.\\d+)|(192\\.168\\.\\d+\\.\\d+)|(22[3-9]\\.\\d+\\.\\d+\\.\\d+)|(2[3-5][0-9]\\.\\d+\\.\\d+\\.\\d+))$");

A more traditional approach to RFC 1918 finding would be like this:

function isRFC1918 (host) { var ip = dnsResolve(host); if (isInNet(ip, "127.0.0.0", "255.0.0.0") ||      isInNet(ip, "10.0.0.0", "255.0.0.0") ||       isInNet(ip, "172.16.0.0", "255.240.0.0") ||       isInNet(ip, "192.168.0.0", "255.255.0.0")) {    return true; }  return false; }

Load sharing and high availability
Sharp in 1996 created the Super Proxy Script a auto-config proxy script that selects proxy servers based upon a hash value of the URL requested. Later updated in 1997 to work optimally with HTTP 1.1 by sending matching directories to the same proxy.

Many mechanisms exist for creating the hash, some are listed below.

Fourth IP octet
As per Novell Cool Solutions: function URLhash (name) { var ip = dnsResolve(host); var octets = ip.split("."); return parseInt(octets[3]); }

Hostname hash
As MSIE caches the proxy per host it is redundant to calculate the hash for the directory. The JavaScript language has also advacned to include charAt and charCodeAt to simplify the code even further. var proxy0 = "PROXY 192.168.0.1:3128"; var proxy1 = "PROXY 192.168.0.2:8080"; function FindProxyForURL(url, host) {  ret = HostHash(host); if ((ret % 3) < 2) return proxy0 + "; " + proxy1 + "; DIRECT"; return proxy1 + "; " + proxy0 + "; DIRECT"; } function HostHash(host) {  var cnt = 0; if (host.length == 0) return cnt; for (var i = host.length - 1; i >= 0; i--) cnt = cnt + host.charCodeAt(i); return cnt; } 220.232.210.142 10:46, 23 October 2007 (UTC)

IPv6 Extensions starting in IE7
This article should mention the IPv6 extensions Microsoft did in Wininet/IE7: http://blogs.msdn.com/wndp/articles/IPV6_PAC_Extensions_v0_9.aspx Apernick (talk) 15:25, 5 January 2009 (UTC)

redirect from Proxy Configuration
As I've said before & elsewhere, "Redirection" requires that whoever establishes the redirection, address the original 'direct' topic, at the redirected location, and not just abandon the original topic to the perhaps long gone or inattentive authors of the redirected topic. (If you wave someone off the road, you are responsible if you've forced them over a cliff.) Failure to do so should be considered vandalism. The original (direct) material should be moved to, merged with, or developed at the redirected location, or at least explained there. (ie: "APC did not exist and is a common mis-spelling of PAC" or "'Proxy Configuration' should be explained here for novice computer users."). Reason for tirade: "(redirect from Automatic Proxy Configuration)" —Preceding unsigned comment added by Wikidity (talk • contribs) 20:44, 17 May 2011 (UTC)

broken link
"Proxy Auto Config for Firefox (PAC). Fully working examples including anti-ad and anti-adult filter rules". 2012-05-12. https://calomel.org/proxy_auto_config.html