PAC file explainer and validator

Paste a Proxy Auto-Config file and it reads back the proxy directives it returns, the PAC helper functions it uses (with the DNS-consulting ones flagged), structural and correctness lints, and whether it is a Netskope explicit-proxy steering file. Never runs the file.

Networking

Runs locally in your browser and never evaluates the file. Nothing you paste leaves this page.

Findings
  • Paste a PAC file (a FindProxyForURL(url, host) function) to have its proxy directives, helper functions, and structure explained. This tool reads the file; it never runs it.
Return values a PAC can produce
  • DIRECTConnect straight to the destination, no proxy.
  • PROXY host:portUse the given HTTP proxy.
  • SOCKS host:portUse the given SOCKS server.
  • HTTP / HTTPS / SOCKS4 / SOCKS5 host:portNewer keywords for a specific proxy type. Semicolon-separated parts are tried left to right as failover.
PAC helper functions used
  • isPlainHostNameTrue when the host has no dots, i.e. an unqualified single-label name. The classic way to send intranet short names DIRECT.
  • dnsDomainIsTrue when the host ends in the given domain suffix. Pure string comparison; no DNS.
  • localHostOrDomainIsTrue on an exact hostname match, or when only the unqualified name is given and it matches. Pure string comparison.
  • isResolvableTries to resolve the host and returns true on success. This consults DNS and can block; use it sparingly.
  • isInNetTrue when the host's IP is in the given subnet (pattern + mask). If a hostname is passed, it is resolved via DNS first, so this can block.
  • dnsResolveResolves a hostname to a dotted IP string. Consults DNS and can block.
  • convert_addrPacks a dotted IPv4 address into a single 32-bit number. Pure arithmetic.
  • myIpAddressReturns the machine's own IP. Unreliable on multi-homed hosts and may fall back to a loopback address like 127.0.0.1; treat its result with caution.
  • dnsDomainLevelsReturns the number of dots in the host. Pure string operation.
  • shExpMatchShell-glob match (* and ?, and [chars] in some browsers). This is NOT a regular expression; regex syntax will not work here.
  • weekdayRangeTrue within a weekday range. Note that the bounds are ordered, so the order of the two days matters.
  • dateRangeTrue within a date range. The bounds are ordered.
  • timeRangeTrue within a time-of-day range. The bounds are ordered.
  • myIpAddressExMicrosoft IPv6 extension of myIpAddress; may return a semicolon-separated list of addresses. Supported by Chromium, not by Firefox.
  • dnsResolveExMicrosoft IPv6 extension of dnsResolve. Consults DNS; Chromium-only.
  • isResolvableExMicrosoft IPv6 extension of isResolvable. Consults DNS; Chromium-only.
  • isInNetExMicrosoft IPv6 extension of isInNet (CIDR prefix form). May consult DNS; Chromium-only.
  • sortIpAddressListMicrosoft helper that sorts a list of IPs by preference. Pure; Chromium-only.
API endpointGEThttps://ronutz.com/api/v1/pac-file-explainerDocumented, not served. Opens the specification.

References