Proxy auto-config

Definition Proxy auto-config (PAC) is a method used by web browsers and other user agents to automatically determine the appropriate proxy server settings for accessing different Uniform Resource Locators (URLs). This is achieved through a JavaScript function defined in a PAC file, which returns a string instructing the client on whether to connect directly or use a specific proxy server for a given URL.

Overview Proxy auto-config was developed to simplify proxy configuration in networked environments where multiple proxy servers are used or where some destinations are accessible only through proxies while others are reachable directly. The PAC mechanism allows administrators to define routing rules based on the URL, hostname, or client IP address. When a user attempts to access a web resource, the browser executes the JavaScript function FindProxyForURL(url, host) from the PAC file to determine the correct network path.

The PAC file is typically hosted on an HTTP server, and clients are directed to it through a URL configured manually or distributed via Dynamic Host Configuration Protocol (DHCP) or Domain Name System (DNS) Service (SRV) records.

Etymology/Origin The term "proxy auto-config" originates from the combination of "proxy," referring to an intermediary server that forwards client requests, and "auto-config," meaning automatic configuration. The technology was first introduced by Netscape in the mid-1990s as part of its web browser suite. The initial implementation allowed enterprises to automate proxy settings, reducing manual configuration burdens.

Characteristics

  • Uses a JavaScript function named FindProxyForURL(url, host), which takes the URL and hostname as arguments.
  • Returns a string specifying one or more proxy servers or a directive to connect directly (e.g., "PROXY proxy1.example.com:8080; DIRECT").
  • Supports conditional logic based on domain names, IP addresses, and network functions such as isPlainHostName(), dnsDomainIs(), or myIpAddress().
  • PAC files are plain text and interpreted by the client, not executed with full JavaScript privileges; certain security restrictions apply.
  • The file is downloaded and cached by the client, typically refreshed at intervals or upon browser restart.
  • Widely supported across modern web browsers, including Chrome, Firefox, and Edge, as well as operating systems like Windows and macOS.

Related Topics

  • Web Proxy Auto-Discovery Protocol (WPAD): A protocol that automatically locates a PAC file on a network using DHCP or DNS.
  • Proxy server: An intermediary server that handles requests on behalf of clients.
  • JavaScript: The scripting language used to define the logic in a PAC file.
  • Network configuration: The broader domain of setting network parameters for devices and services.
  • Enterprise network management: The use of PAC in organizational environments to manage internet access efficiently.

Accurate information on implementation specifics and limitations in certain environments may vary depending on client software and versions.

Browse

More topics to explore