Compose a Proxy Auto-Config file the same way browsers expect: a FindProxyForURL(url, host) function that walks down a list of rules and returns DIRECT, PROXY host:port, SOCKS5 host:port, or HTTPS host:port. Each rule below maps a match (host suffix, exact host, IP range, scheme, or substring) to a target string. Below the editor you can run the generated function against test URLs to confirm routing — the same evaluation order the browser uses.
proxy.pacapplication/x-ns-proxy-autoconfig. Most browsers cache aggressively — bump the filename or path to force a refetch.One URL per line. The matched rule index and the returned proxy string are shown for each.
| Match | What it checks | Built on |
|---|---|---|
| host suffix | Hostname ends with the pattern (.example.com matches www.example.com and bare example.com). | dnsDomainIs |
| exact host | Hostname equals the pattern. | host == |
| glob | Shell glob with * on the URL (e.g. http://*/admin/*). | shExpMatch |
| in net | Resolved IP falls in a CIDR (10.0.0.0/8). | isInNet + dnsResolve |
| plain host | Hostname has no dots (intranet single-label names). | isPlainHostName |
| scheme is | URL scheme equals (http, https, ftp). | url.startsWith |
| url contains | Substring is anywhere in the URL. | url.indexOf |
Targets follow the PAC return-string grammar: DIRECT, PROXY host:port, SOCKS host:port, SOCKS5 host:port, or HTTPS host:port (Chromium / Firefox). You can chain fallbacks with a semicolon — browsers try the next entry if the first fails (e.g. PROXY a:8080; PROXY b:8080; DIRECT). This builder writes the chosen target as-is, so multi-entry chains work too.