30 October 2012

automatic proxy configuration for your pc

A proxy auto-config (PAC) file contains a JavaScript function "indProxyForURL(url, host)". This function returns a string with one or more access method specifications.

The URL of the PAC file is either configured manually or determined automatically by the Web Proxy Autodiscovery Protocol.

A very simple example of a PAC file is:
function FindProxyForURL(url, host)
{
   return "PROXY proxy.example.com:8080; DIRECT";
}

The Web Proxy Auto-Discovery Protocol (WPAD) is a method used by clients to locate a URL of a configuration file using DHCP and/or DNS discovery.

Before fetching its first page,
- a web browser sends the local DHCP server a DHCPINFORM query, and uses the URL from the WPAD option in the server's reply. [option 252 ("auto-proxy-config")]
- If the DHCP server does not provide the desired information, DNS is used. [A Web server must be configured to serve the WPAD file with a MIME type of "application/x-ns-proxy-autoconfig"]
c:\> nslookup wpad
On success check for "http://wpad/wpad.dat"

Reference:
http://en.wikipedia.org/wiki/Proxy_auto-config
http://en.wikipedia.org/wiki/Web_Proxy_Autodiscovery_Protocol

No comments:

Post a Comment