← All Tools

PAC File Builder

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.

Rules

Used when no rule matched.

Generated proxy.pac


  
Serve as application/x-ns-proxy-autoconfig. Most browsers cache aggressively — bump the filename or path to force a refetch.

Test single URL

Batch test

One URL per line. The matched rule index and the returned proxy string are shown for each.

Match types & targets

Match What it checks Built on
host suffixHostname ends with the pattern (.example.com matches www.example.com and bare example.com).dnsDomainIs
exact hostHostname equals the pattern.host ==
globShell glob with * on the URL (e.g. http://*/admin/*).shExpMatch
in netResolved IP falls in a CIDR (10.0.0.0/8).isInNet + dnsResolve
plain hostHostname has no dots (intranet single-label names).isPlainHostName
scheme isURL scheme equals (http, https, ftp).url.startsWith
url containsSubstring 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.