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>throughhost:port. - hostname_
fits - Whether
labelis a legal DNS label and<label>.<tld>fits in a host name. - is_
valid_ tld - Whether
tldis a valid DNS suffix that leaves room for a name under it. - url
- URL the PAC script is served from.