pacparser
Used by: pactester, python pacparser, old findproxyforurl.net backend.
Helper library
The checker runs this engine's own PAC helper library, copied verbatim at v1.5.3 (LGPL-3.0-or-later).
Upstream source.
Version ranges and quirks
pacparser ≤ 1.4
| Behaviour | Value | Source |
|---|---|---|
| alert() output | error | lab, verified 2026-10-04 |
| Non-ASCII result rejected | false | code, verified 2026-10-04 |
| DNS lookups | sync | code, verified 2026-10-04 |
| dnsResolve is IPv4 only | true | code, verified 2026-10-04 |
| JavaScript level accepted | 3 | doc, verified 2026-10-04 |
| Calls FindProxyForURLEx if defined | true | code, verified 2026-10-04 |
| Microsoft *Ex functions | true | doc, verified 2026-10-04 |
| Global variables persist between calls | true | code, verified 2026-10-04 |
| International host names passed in punycode (xn--) | false | lab, verified 2026-10-15 |
| Host lower-cased by the engine | false | code, verified 2026-10-04 |
| myIpAddress() source | user_supplied | code, verified 2026-10-04 |
| Functions built into the engine (native) | dnsResolve, myIpAddress, dnsResolveEx, myIpAddressEx | doc, verified 2026-10-04 |
| On exception | error | code, verified 2026-10-04 |
| On non-string / undefined result | stringify | code, verified 2026-10-04 |
| URL passed to FindProxyForURL | none | code, verified 2026-10-04 |
pacparser ≥ 1.5.1
| Behaviour | Value | Source |
|---|---|---|
| alert() output | console | code, verified 2026-10-04 |
| JavaScript level accepted | latest | doc, verified 2026-10-04 |
| Functions built into the engine (native) | dnsResolve, myIpAddress, dnsResolveEx, myIpAddressEx, alert | code, verified 2026-10-04 |
Function availability
| Function | chromium | chromium | firefox | pacparser | pacparser | winhttp | wininet | reference |
|---|---|---|---|---|---|---|---|---|
isPlainHostName | yes | yes | yes | yes | yes | yes | yes | yes |
dnsDomainIs | yes | yes | yes | yes | yes | yes | yes | yes |
localHostOrDomainIs | yes | yes | yes | yes | yes | yes | yes | yes |
isResolvable | yes | yes | yes | yes | yes | yes | yes | yes |
isInNet | yes | yes | yes | yes | yes | yes | yes | yes |
dnsResolve | yes | yes | yes | yes | yes | yes | yes | yes |
myIpAddress | yes | yes | yes | yes | yes | yes | yes | yes |
dnsDomainLevels | yes | yes | yes | yes | yes | yes | yes | yes |
shExpMatch | yes | yes | yes | yes | yes | yes | yes | yes |
weekdayRange | yes | yes | yes | yes | yes | yes | yes | yes |
dateRange | yes | yes | yes | yes | yes | yes | yes | yes |
timeRange | yes | yes | yes | yes | yes | yes | yes | yes |
alert | yes | yes | yes | no | yes | yes | yes | yes |
dnsResolveEx | yes | yes | no | yes | yes | yes | yes | no |
myIpAddressEx | yes | yes | no | yes | yes | yes | yes | no |
isResolvableEx | yes | yes | no | yes | yes | yes | yes | no |
isInNetEx | yes | yes | no | yes | yes | yes | yes | no |
sortIpAddressList | yes | yes | no | no | no | yes | yes | no |
Rules with notes for pacparser
- PAC-C001Hostname pattern applied to url instead of host
shExpMatch(url, "example.com") does not match http://example.com/x; the same pattern on host does. lab, verified 2026-05-20
- PAC-C012IPv4 loopback/private ranges handled, IPv6 equivalents not
Passes the host exactly as it is given (pactester -h, or the second argument of find_proxy). When no host is given, pactester and the Python module take it from the URL up to the first colon, so http://[fd00::10]:8090/ gives the host [fd00 and no IPv6 test can match. code, verified 2026-10-15 · ref
- PAC-C018Upper-case letters in a hostname pattern
Passes host as given; dnsDomainIs(host, ".example.com") does not match "Example.com". lab, verified 2026-05-20
- PAC-C031IP address written with leading zeros, in hex, as one number or in short form
Passes the host as given; isInNet reads parts of up to three digits as decimal and resolves longer forms, dnsResolve reads leading zeros as octal. lab, verified 2026-10-11 · ref
- PAC-E010isInNet called with an invalid address, mask or argument count
No check of pattern or mask, so a CIDR network or a short mask can still match; a missing mask throws. lab, verified 2026-10-11 · ref
- PAC-E012Proxy port out of range or not numeric
Returns the malformed string unchanged; no validation. lab, verified 2026-05-20
- PAC-E018Browser or Node.js objects used in the PAC
window, setTimeout and fetch are undefined in 1.4.6 and 1.5.3; using them throws. lab, verified 2026-10-04
- PAC-K001ES2015 to ES2017 syntax (let, const, arrow functions, template literals)
Depends on the version. pacparser 1.5.0 and newer (QuickJS engine) accept ES2015 syntax such as let and arrow functions; 1.4.x (SpiderMonkey 1.7) rejects it, and the file does not load (lab, 1.5.3 and 1.4.6). lab, verified 2026-10-04
- PAC-K002alert() used in the PAC
Depends on the version. Since 1.5.1, alert writes the message to standard error and the script continues; in 1.4.x alert is not defined, so the call throws an error (lab, 1.5.3 and 1.4.6). lab, verified 2026-10-04
- PAC-K003IPv6 extension functions (isInNetEx, dnsResolveEx, myIpAddressEx)
Four of the six are present (dnsResolveEx, isInNetEx, myIpAddressEx, isResolvableEx); sortIpAddressList and getClientVersion are undefined. Measured in 1.4.6 and 1.5.3. lab, verified 2026-10-04
- PAC-K007Time functions that answer differently per engine (weekdayRange, dateRange, timeRange)
No wrap-around in weekdayRange or dateRange; such ranges are never true. Because the week starts on Sunday, weekdayRange("MON", "SUN") is a wrap-around range too and is always false. The source shows that timeRange works the same way. lab, verified 2026-10-04
- PAC-K009Case-sensitive host comparisons without lower-casing host
Passes host as given to pactester; case-sensitive comparison. lab, verified 2026-05-20
- PAC-K013Routing decided by myIpAddress()
Resolves the local host name via getaddrinfo (hosts file, DNS) and falls back to 127.0.0.1; a fixed value can be set with pactester -c or setmyip(). lab, verified 2026-10-11 · ref
- PAC-K022console used in the PAC
console is defined in 1.5.3 and undefined in 1.4.6, where a call throws. lab, verified 2026-10-04
- PAC-P004dnsResolve called repeatedly for the same host
No cache: every call asks the system's resolver again. 150 calls for one name sent 150 queries on a system without a caching DNS service. lab, verified 2026-10-14 · ref
- PAC-X001No unconditional return at the end of FindProxyForURL
Returns undefined to the caller (pactester prints "undefined"). lab, verified 2026-05-20
- PAC-X002Trailing * in a host pattern matches attacker-controlled suffixes
"example.com*" matches example.com.evil.test lab, verified 2026-05-20
- PAC-X003dnsDomainIs pattern without a leading dot matches look-alike domains
dnsDomainIs(host, "example.com") is true for a look-alike ending in "example.com", for example.com itself and for www.example.com. lab, verified 2026-05-20
- PAC-X004Leading * without a dot matches look-alike domains
"*example.com" matches a look-alike domain ending in "example.com"; "*.example.com" does not. lab, verified 2026-05-20
- PAC-X006IP range matched as a text prefix
"127.*" matches the hostname 127.foo.evil.test; "127example.test" does not (the dot is required). lab, verified 2026-05-20
- PAC-X012Wildcard inside a domain label
A pattern of the form "name*.tld" matches look-alike names with extra characters before the TLD. lab, verified 2026-05-20
- PAC-X013PROXY entry without a port
Returns the unported string unchanged; no validation. lab, verified 2026-05-20