Windows WinHTTP (system services, BITS)
Used by: Windows services, BITS, apps using WinHTTP.
Windows WinINet (desktop apps, .NET, Java) runs PAC files in the same script engine and differs only in the points listed on its page. The table what WinHTTP and WinINet share and where they differ compares the two.
Helper library
Emulated helper library (CC0-1.0).
Version ranges and quirks
Windows 11 WinHTTP
| Behaviour | Value | Source |
|---|---|---|
| alert() output | ignored | lab, verified 2026-10-11 |
| Non-ASCII result rejected | false | lab, verified 2026-10-11 |
| shExpMatch is case-sensitive | true | lab, verified 2026-10-11 |
| DNS lookups | sync | lab, verified 2026-10-14 |
| dnsResolve is IPv4 only | true | lab, verified 2026-10-11 |
| JavaScript level accepted | 2017 | lab, verified 2026-10-11 |
| Calls FindProxyForURLEx if defined | true | lab, verified 2026-10-11 |
| Microsoft *Ex functions | true | lab, verified 2026-10-11 |
| Global variables persist between calls | true | lab, verified 2026-10-11 |
| International host names passed in punycode (xn--) | true | lab, verified 2026-10-15 |
| IPv6 host passed in brackets | true | lab, verified 2026-10-11 |
| Host lower-cased by the engine | false | lab, verified 2026-10-15 |
| Largest PAC file accepted (bytes) | 1048576 | lab, verified 2026-10-11 |
| myIpAddress() source | first_adapter_by_metric | lab, verified 2026-10-14 |
| Functions built into the engine (native) | isPlainHostName, dnsDomainIs, localHostOrDomainIs, isResolvable, isInNet, dnsResolve, myIpAddress, dnsDomainLevels, shExpMatch, weekdayRange, dateRange, timeRange, alert, isResolvableEx, isInNetEx, dnsResolveEx, myIpAddressEx, sortIpAddressList, getClientVersion | lab, verified 2026-10-11 |
| On exception | error | lab, verified 2026-10-11 |
| On non-string / undefined result | stringify | lab, verified 2026-10-11 |
| How the returned string is read | windows | lab, verified 2026-10-11 |
| Proxy keywords understood | PROXY, HTTPS, SOCKS, DIRECT | lab, verified 2026-10-11 |
| Answer reused per host | per_host | lab, verified 2026-10-11 |
| Time limit for the script | none | lab, verified 2026-10-11 |
| dateRange() and timeRange() | always_false | lab, verified 2026-10-11 |
| URL passed to FindProxyForURL | https_to_origin | lab, verified 2026-10-12 |
| weekdayRange() day names | upper_case_only | lab, verified 2026-10-11 |
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 winhttp
- PAC-C001Hostname pattern applied to url instead of host
https URLs are cut to scheme://host:port/ (path, query and user name removed); http URLs keep path, query and fragment, but a user name and password before the host are removed there too. Later requests to the same host and scheme with a different path or port could get an earlier, cached answer. lab, verified 2026-10-12
- PAC-C011Very short or trailing-dot dnsDomainIs pattern
A trailing dot is kept in host and url; dnsDomainIs(host, ".example.test") is false. lab, verified 2026-10-15
- PAC-C012IPv4 loopback/private ranges handled, IPv6 equivalents not
An IPv6 address reaches the script in brackets and with its letters as written (http://[fd00::10]:8090/ arrives as host [fd00::10], http://[FD00::A1]:8090/ as [FD00::A1]); the host part of url keeps them too. lab, verified 2026-10-15
- PAC-C018Upper-case letters in a hostname pattern
host keeps its case (Example.COM arrives as Example.COM, also from BITS). dnsDomainIs and shExpMatch compare case-sensitively; localHostOrDomainIs ignores case. lab, verified 2026-10-11
- PAC-C031IP address written with leading zeros, in hex, as one number or in short form
Passes the host as written; reads leading zeros as octal in isInNet; dnsResolve returns address-like text unchanged; returns a proxy entry unchanged, and the Windows address lookup reads the forms like the browsers. lab, verified 2026-10-11
- PAC-D001PAC served over plain HTTP
An https PAC URL whose certificate the client did not trust failed to download (error 12167); no PAC was used. lab, verified 2026-10-11
- PAC-D002Content-Type is not application/x-ns-proxy-autoconfig
The file loaded with no Content-Type header, with text/html and with application/javascript; the type is ignored. lab, verified 2026-10-11
- PAC-D006Large PAC served without compression
A PAC sent gzip-compressed (Content-Encoding: gzip) failed to load. lab, verified 2026-10-11
- PAC-D007PAC distributed via WPAD DNS discovery
Without a suffix search list: wpad under the primary DNS suffix, then under the connection's own suffix, then wpad.local by multicast DNS, WPAD by NetBIOS and wpad by LLMNR. With a suffix search list: wpad under each listed suffix in order, and no multicast, NetBIOS or LLMNR queries. No DHCP packet was seen during these detection runs. lab, verified 2026-10-11
- PAC-D009PAC loaded from a file path or SMB share
A file:// PAC URL was rejected (error 12006, an unrecognised URL); no PAC was loaded. lab, verified 2026-10-11
- PAC-D010PAC URL does not return 200
Only status 200 is accepted; 203, 204, 404 and 500 all failed (error 12167). A 302 redirect to the PAC, relative or absolute, was followed and the file loaded. A 401 answer (Basic or NTLM) failed (error 12015). A server that took 29 seconds to answer still worked; one that took 40 seconds failed after about 30 seconds (error 12167). lab, verified 2026-10-11
- PAC-D011PAC file is larger than 1 MiB
A PAC body of 1,048,576 bytes loaded; 1,048,577 bytes and larger (also 2, 10 and 33 MiB) failed to download (error 12167), so no PAC was used. lab, verified 2026-10-11
- PAC-D012PAC URL asks for a login
A 401 answer with a Basic or an NTLM login request failed (error 12015); no PAC was used. lab, verified 2026-10-11
- PAC-D013PAC file is served as UTF-16
A UTF-16 file with byte order mark failed to load (error 12166). UTF-8 with or without byte order mark loaded; a Latin-1 file loaded with its non-ASCII characters garbled. lab, verified 2026-10-11
- PAC-D014Server compresses the PAC file although the client did not ask
A PAC file that the server always sent gzip-compressed failed to load (error 12166); no PAC was used. lab, verified 2026-10-11
- PAC-E001PAC file does not parse
A file that does not compile gives the calling program an error instead of a proxy list; what happens next depends on the program. lab, verified 2026-10-11
- PAC-E002No FindProxyForURL function
A file whose function is spelled findProxyForURL fails with an error to the calling program. A file that defines only FindProxyForURLEx works. lab, verified 2026-10-11
- PAC-E006Evaluation throws an exception
An exception gives the calling program an error instead of a proxy list. .NET Framework and .NET 8 programs then connected directly without showing an error. lab, verified 2026-10-11
- PAC-E007Evaluation did not finish within the time limit
No time limit was observed: a script with an endless loop blocked the calling program for more than 18 minutes, and the script kept running after that program was ended. No memory limit was observed either: a script that kept allocating memory grew to 2.9 GiB. lab, verified 2026-10-11
- PAC-E008Loop without a reachable exit
An endless loop was not stopped: it blocked the calling program for more than 18 minutes and kept running after that program was ended. lab, verified 2026-10-11
- PAC-E010isInNet called with an invalid address, mask or argument count
Own implementation without a check of the mask; answers short masks, leading zeros and a missing mask differently from the browsers. lab, verified 2026-10-11
- PAC-E011Return value is not a valid proxy string
Lenient and different from Chromium: "PROXY a:3128 DIRECT" (no ';') and a tab between entries give DIRECT; lower-case "proxy" or "direct" is ignored; a ',' also separates entries; one empty entry ("PROXY ; PROXY b:1") removes the whole list; the keyword HTTP gives no entries; an unknown keyword is skipped; "PROXY DIRECTORY:80" is read as DIRECT; "PROXY http://a:8080" becomes the proxy "http" on port 80; an IPv6 proxy without brackets is cut at the first ':'. undefined, null and a number give no entries. lab, verified 2026-10-11
- PAC-E012Proxy port out of range or not numeric
The entry is kept with a different port: 99999 became 34463, -1 became 65535, 0 became 80 and "80abc" became 80. lab, verified 2026-10-11
- PAC-E013File saved as UTF-16 instead of UTF-8 or ASCII
A UTF-8 file with or without a byte order mark loads normally. A UTF-16 file and a gzip-compressed response fail to load; a Latin-1 file loads, but its non-ASCII characters are garbled. lab, verified 2026-10-11
- PAC-E014Non-ASCII characters in code
An internationalised host arrives in lower-case punycode, in host and in url, although WinHTTP keeps the case of plain ASCII host names. The other labels of such a name are lower-cased too (BÜCHER-Case.Example.test arrives as xn--bcher-case-9db.example.test). lab, verified 2026-10-15
- PAC-E017PAC helper called with the wrong number of arguments
isPlainHostName, isInNet and weekdayRange raised an error that ends the script when an argument was missing, extra or null, for example isPlainHostName(), isPlainHostName("a", "b"), isInNet with two or four arguments and weekdayRange(null). dateRange() and timeRange() without arguments returned false. lab, verified 2026-10-11
- PAC-E018Browser or Node.js objects used in the PAC
window and navigator are undefined; using them throws. lab, verified 2026-10-11
- PAC-K001ES2015 to ES2017 syntax (let, const, arrow functions, template literals)
About ES2017. let, const, arrow functions, classes, template strings, destructuring, array spread, async functions and generators work; optional chaining (?.), ??, object spread, BigInt literals, regular-expression lookbehind and named groups are syntax errors, and then the whole file fails to load. lab, verified 2026-10-11
- PAC-K002alert() used in the PAC
alert exists and returns false, with or without arguments; the script continues. lab, verified 2026-10-11
- PAC-K003IPv6 extension functions (isInNetEx, dnsResolveEx, myIpAddressEx)
All six are present (isResolvableEx, isInNetEx, dnsResolveEx, myIpAddressEx, sortIpAddressList, getClientVersion). dnsResolveEx lists IPv4 and IPv6 addresses separated by ';' with IPv6 in brackets, and returns false for a name that does not resolve; isInNetEx needs a prefix such as /8, does not look up host names and is false for /0; getClientVersion returns "1.0". lab, verified 2026-10-11
- PAC-K004FindProxyForURLEx entry point
When both functions are defined, FindProxyForURLEx decides; a file that defines only FindProxyForURLEx works. lab, verified 2026-10-11
- PAC-K005SOCKS keywords mean different versions on different engines
"SOCKS s:1080" is returned as a SOCKS entry; a missing port becomes 1080. "SOCKS5 s:1080" and "SOCKS4 s:1080" are misread as a plain SOCKS entry with the broken host name "5 s" or "4 s". .NET Framework and .NET 8 programs went direct instead of using a SOCKS entry. lab, verified 2026-10-11
- PAC-K006HTTPS proxy keyword without a PROXY fallback
The HTTPS entry is returned to the program unchanged. A program that sets that entry on its request connects to the proxy with TLS and sends the request inside (GET for http, CONNECT for https); when the proxy's certificate does not match the proxy name, the request fails and the program gets an error. A .NET Framework program turned the entry into a broken proxy address and its request failed; a .NET 8 program skipped it for http requests and used no proxy. lab, verified 2026-10-15
- PAC-K007Time functions that answer differently per engine (weekdayRange, dateRange, timeRange)
dateRange and timeRange always return false, whatever the arguments. weekdayRange works with upper-case day names and wraps (FRI to MON); lower-case names raise an error or give false. lab, verified 2026-10-11
- PAC-K008Mutable state outside FindProxyForURL
Top-level variables keep their values between calls; a counter increased by FindProxyForURL gave a different answer on the second call. lab, verified 2026-10-11
- PAC-K009Case-sensitive host comparisons without lower-casing host
The host is passed with the case the program used (Example.COM stays Example.COM); BITS showed the same. An IPv6 host arrives in brackets with its case kept. lab, verified 2026-10-11
- PAC-K010ES2015+ library methods (startsWith, flat, replaceAll, globalThis)
Present: Array includes, String padStart, Object.entries, Map, Set, Promise, Symbol, Proxy, Reflect. Missing (undefined, so a call throws): Array flat, Object.fromEntries, String replaceAll, Array at, globalThis. lab, verified 2026-10-11
- PAC-K013Routing decided by myIpAddress()
Does not follow the route. With several adapters it returned the address of the first adapter in Windows' order (lowest interface metric), also when that adapter had no route to the internet; never a 169.254.x.x address while another address existed. With a full-tunnel VPN (Windows' built-in client) the VPN address, with split tunnelling the first physical adapter. myIpAddressEx lists all addresses, including link-local and 169.254.x.x ones. lab, verified 2026-10-14
- PAC-K015Regular-expression syntax inside a shExpMatch pattern
Only * and ? are wildcards; [ ] + ( ) | { } $ are matched literally, so regex alternation never matches. A ^ in the pattern changes the match (shExpMatch("x^", "x^") is false). Matching is case-sensitive. lab, verified 2026-10-11
- PAC-K020JavaScript syntax newer than ES2017 (?., ??, object spread)
Optional chaining (?.), ??, object spread, BigInt literals, regular-expression lookbehind and named groups are syntax errors, and then the whole file fails to load. ES2015 to ES2017 syntax (let, const, arrow functions, classes, template strings, array spread, async functions, generators, **) works. lab, verified 2026-10-11
- PAC-K021Decision depends on the URL path or query
https URLs reach the script as https://host:port/. http URLs reach it whole, but later requests to the same host and scheme, also with another path or port, got an answer that the script had given for an earlier request. lab, verified 2026-10-11
- PAC-K022console used in the PAC
console is undefined; a call throws and the request is handled as a script failure. lab, verified 2026-10-11
- PAC-P001DNS function on the path of every request
The script waits on every DNS call. When the DNS server does not answer, each call waits about 12 s and the failure is not kept, not even inside one run (Windows 11, lab). lab, verified 2026-10-16
- PAC-P004dnsResolve called repeatedly for the same host
Repeats for a name that resolves are answered from the Windows DNS cache (150 calls, one query). When the DNS server does not answer, every call waits about 12 s again, also inside one run (Windows 11, lab). lab, verified 2026-10-14
- PAC-P006PAC file is large
A PAC body of 1,048,576 bytes (1 MiB) loads; one byte more and the download fails, so the file is not used. lab, verified 2026-10-11
- PAC-X001No unconditional return at the end of FindProxyForURL
undefined, null or a number as the result gives an empty list, so the program uses no proxy. lab, verified 2026-10-11
- PAC-X009Pattern with leading and trailing * is a substring match
The query and path trick works for http (path and query reach the script). The user-name trick does not work; https URLs are cut to https://host:port/, and a user name and password are removed from http URLs too. lab, verified 2026-10-12
- PAC-X013PROXY entry without a port
A missing port becomes 80; the entry is kept, not rejected. lab, verified 2026-10-11
- PAC-X014DIRECT as fallback after a proxy
Windows returns the whole list, DIRECT included. Older Windows programs (.NET Framework, .NET 8) get only the entries before the first DIRECT: .NET Framework programs then added a DIRECT of their own after the last proxy, even where the PAC returned no DIRECT, while .NET 8 programs did not fall back to DIRECT at all. lab, verified 2026-10-11