Skip to main content

Module pac

Module pac 

Source
Expand description

Proxy auto-config (PAC) generation.

The PAC file is the no-sudo path to working hostnames: instead of teaching the system resolver about the TLD, the browser is told to send every request for *.<tld> through the proxy and everything else direct. The proxy then resolves the name itself, so nothing has to be written to /etc/resolver or /etc/hosts.

The supervisor serves the generated script at /proxy.pac on the proxy’s own listener, which is the one HTTP endpoint that always exists when the proxy is enabled.

Constants§

PAC_PATH
Path the supervisor serves the PAC script from.

Functions§

generate
Generate the PAC script routing *.<tld> through host:port.
hostname_fits
Whether label is a legal DNS label and <label>.<tld> fits in a host name.
is_valid_tld
Whether tld is a valid DNS suffix that leaves room for a name under it.
url
URL the PAC script is served from.