A Proxy Auto-Configuration (PAC) file is a JavaScript function that determines whether web browser requests (HTTP, HTTPS, and FTP) go directly to the destination or are sent to a web proxy server. It contains a JavaScript function that routes the web requests via some web proxy server instead of sending these directly to the destination.

The function defined in the PAC using JavaScript is as follows:

function FindProxyForURL(url, host) {
// …
}

The FindProxyForURL function contains the following arguments:

  • url: The URL of the request in the form protocol://hostname.port/path. The host name can be a domain name or IP address. Port number is optional if the default port is used for the given protocol—for example, port 80 or http URLs or port 443 for https URLs. Example: https://www.example.com:8443/mypage.htm

  • host: The host name extracted from the URL string. Example: For the URL in the example above, the host is www.example.com. 

To enable a PAC file that you've configured, add the following configuration settings in the admin_settings.yaml file:

  • Set enable_pac_proxy to true.

  • Provide the host details in the proxy_pac_url.

enable_pac_proxy: true
proxy_pac_url: http://localhost:8000/proxy_pac1.pac

To download the latest admin_settings.yaml file, refer to Downloading the admin_settings file.