DIRECT as fallback after a proxy
info
"PROXY proxy.corp.example:8080; DIRECT" keeps users online when the proxy is down, at the price of uninspected traffic during the outage. Make sure that trade-off is intended.
Why it matters
Browsers try the entries in order and move on when a connection to a proxy fails. A
trailing DIRECT therefore means: if the proxy is down (or blocked, or the laptop is on a
network where the proxy is unreachable), send everything directly. For a roaming laptop
that is often the intended behaviour; for a managed desktop behind a default-deny firewall
it is a policy gap that is invisible until the proxy has an incident. Browsers also
remember a failed proxy for some minutes, so a short outage turns into a longer bypass.
A second proxy as fallback keeps inspection in place.
Windows programs do not all follow the list either. In the lab (2026-10-11) older Windows
programs, such as those built on .NET Framework or .NET 8, only saw the entries before the
first DIRECT, so a proxy listed after DIRECT was never tried. Programs built on .NET Framework added a DIRECT of their own after the last
proxy, even when the PAC returned none, while .NET 8 programs failed instead of going
DIRECT.
How to fix
Prefer a second proxy ("PROXY p1:8080; PROXY p2:8080"); keep DIRECT fallback only where uninspected traffic during an outage is acceptable, and say so in a comment.
Examples
Bad
function FindProxyForURL(url, host) {
return "PROXY proxy1.corp.example:8080; DIRECT";
}
Open bad example in checkerGood
function FindProxyForURL(url, host) {
return "PROXY proxy1.corp.example:8080; PROXY proxy2.corp.example:8080";
}
Open good example in checkerEngine behaviour
| Engine | Behaviour | Source |
|---|---|---|
| chromium | When every listed proxy is unreachable and the list has no DIRECT, the request fails; the browser does not go direct on its own. | lab, verified 2026-10-04 |
| winhttp | 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 |
Related rules
- Single proxy without a fallback entry PAC-B011
- No unconditional return at the end of FindProxyForURL PAC-X001