concept Networks
Proxy auto-configuration decision paths
A proxy auto-configuration policy tells a browser which routes to try, not which one worked. Follow a hostname through an exact match, a dotted suffix, and an ordered proxy list to see why the same DIRECT result can have two causes.
What it means
A proxy auto-configuration (PAC) policy decides which route or routes a browser should try for a URL. It can name a proxy, specify DIRECT (no proxy), or return several choices in order. Matching a rule answers “What should the browser try?” It does not answer “Did the connection work?”
Try it
Simulation: Start with app.example.test, both proxies up, the supplied address class public, and scenario evidence provided. The result is DIRECT. The exact-host rule matches first, so neither proxy’s availability nor the address class is used.
Proxy auto-configuration decision paths
Explain per-URL PAC routing decisions and fallback without executing arbitrary PAC JavaScript
The first exact-host rule wins; no fallback proxies evaluated.
Policy
- Hostnameapp.example.test
- Exact-host ruleMatched
- Dot suffix ruleNot evaluated
- Address classNot established
Candidates
- Proxy ANot evaluated
- Proxy BNot evaluated
- Selected resultDIRECT
A selected route is not an observed successful connection. Only the suffix branch evaluates proxy availability.
Evaluated inputs
- Required scenario evidence
- provided
- Hostname
- app.example.test
Not evaluated: Supplied resolved address class · First proxy availability · Second proxy availability
Fixed illustrative policy; supplied DNS class not actual resolution. Only suffix branch models availability/fallback; other proxy outputs are policy choices, not connection success. No PAC JavaScript execution or browser-specific retry timings.
About this model
The controls set only a local, bounded scenario. The computed branch is not a verdict about a live system. Inputs listed as not evaluated did not participate in this branch after validation.
Reset restores the original inputs. It does not change the open or closed state of help or FAQ answers.
- Set First proxy availability to
down. The result staysDIRECT. Proxy A has not been skipped because it is down; it was never a candidate for this exact host. - Change only the hostname to
api.example.test. The exact rule no longer matches, but the name ends in.example.test. That rule lists A first, B second, andDIRECTlast. With Adownand Bup, the result isPROXY B. - Set Second proxy availability to
downtoo. The result is nowDIRECTbecause the suffix rule explicitly permits it after both proxies are unavailable. It is the same result as at the start, for a different reason.
Reset restores the original hostname, address class, proxy settings, and evidence setting. The availability settings are assumptions for the example, not reports from proxy servers.
Where the dot changes the decision
The hostname field accepts a limited dot-separated ASCII syntax (letters, digits, and hyphens). It is not a complete DNS, IDNA, or URL validator. Enter a name, not a URL; https://app.example.test produces an input error rather than a route.
The suffix test looks for .example.test, including the leading dot. In api.example.test, the dot separates api from example. In notexample.test, the letters example are part of the label notexample. The text example.test appears at the end of both names, but only the first name matches the suffix rule. The bare name example.test does not match that rule either.
Only after both hostname rules miss does the supplied address class matter. For notexample.test, public gives PROXY B policy; changing the class to private gives PROXY A policy. Here the result names the proxy the policy selects. Unlike PROXY B in the suffix example, it says nothing about availability: neither proxy setting was consulted, and the model does not proceed to DIRECT if the selected proxy is down.
With the class set to unknown for that same host, there is no route result. The missing fact is specific: the model needs the address class to choose between A and B. Setting Required scenario evidence to missing is different: for otherwise valid inputs, it stops the decision before even the exact-host rule is evaluated. Neither kind of unknown means DIRECT.
In practice
When a route surprises you, separate the policy decision from the connection evidence. First identify the hostname the policy considered, the first rule that matched, and the choices that rule returned, in order. If a rule depends on a resolved address, distinguish the address information used for that decision from an assumption about what the name resolves to. Then ask which candidate the client actually attempted and what happened. A proxy appearing second in a list is not evidence that the client contacted it.
The simulation neither runs a PAC file nor performs DNS lookups or connection attempts. Its up and down choices simplify one part of one rule. In Chromium, the kind of connection failure matters to whether another proxy is tried. Failure to fetch the PAC file is a separate case, where it matters whether PAC is mandatory. The simulation does not predict either behavior for your browser.
If all you have is a PAC return value, report the choices it permits. To explain an observed direct connection, distinguish a rule that chose DIRECT immediately from one that listed it as a fallback, then look for evidence of the client’s attempts. The word DIRECT alone cannot tell you which path led there.
Frequently asked questions
Editorial questions based on the listed sources and explicitly labeled local examples.
Can PAC return several proxies?
Yes, a return value can specify an ordered list.
Is DIRECT an automatic final option?
Not automatically. In the suffix branch here it is an explicit final candidate after both stipulated proxies are unavailable. Real retry and PAC-fetch fallback behavior depends on the browser and policy; a failed proxy is not evidence that a direct connection is permitted.
Do all suffix strings match subdomains?
In the fixed policy here, a hostname matches the stipulated suffix only at a label boundary. A matching character substring alone is insufficient; the lab does not execute arbitrary PAC functions.
Can this lab run my PAC file?
No. It evaluates a fixed synthetic policy only.
Sources & model boundaries
Primary references used for this explanation. The interactive example is an educational model, not a live check.
- Mozilla MDN: PAC file
FindProxyForURL; Return value. PAC return values can contain a sequence of proxy choices and an explicit DIRECT entry. Fallback details depend on browser implementation and policy.
Checked .
- Chromium: Proxy support in Chrome
Proxy fallback. Chromium documents that proxy fallback depends on connection failure classification and mandatory PAC settings. The simple lab is not a universal browser fallback algorithm.
Checked .