# FindProxyForURLEx entry point

Source: https://findproxyforurl.net/rules/findproxyforurlex-only/ · last updated 2026-10-11

Rule PAC-K004 (`findproxyforurlex-only`), severity medium, category: Compatibility across engines.

FindProxyForURLEx is the PAC v2 entry point from Microsoft's IPv6 extensions. Chromium and Firefox ignore it and call FindProxyForURL. A file that relies on the Ex function alone has no effect in browsers.

## Why it matters

Windows (WinHTTP) calls `FindProxyForURLEx` whenever the file defines it and falls back to
`FindProxyForURL` otherwise; in the lab on Windows 11 (2026-10-11) the Ex function won when
both were defined, and a file with only the Ex function worked. Browsers do not know the Ex
entry point. Defining both is legal but
doubles the logic that has to be kept in sync; defining only the Ex form leaves browsers
without a PAC (PAC-E002 reports the missing standard function). Unless the deployment is
WinHTTP-only, keep the standard function as the single source of truth.


## How to fix

Keep FindProxyForURL as the entry point; if FindProxyForURLEx is required, make it delegate to FindProxyForURL.

## Bad

```js
function FindProxyForURLEx(url, host) {
  if (isInNetEx(host, "fd00::/8")) {
    return "DIRECT";
  }
  return "PROXY proxy.corp.example:8080";
}
```

## Good

```js
function FindProxyForURL(url, host) {
  if (shExpMatch(host, "fd*:*")) {
    return "DIRECT";
  }
  return "PROXY proxy.corp.example:8080";
}
function FindProxyForURLEx(url, host) {
  return FindProxyForURL(url, host);
}
```

## Engine behaviour

- chromium: Only FindProxyForURL is called. (source: code, verified 2026-10-04)
- winhttp: When both functions are defined, FindProxyForURLEx decides; a file that defines only FindProxyForURLEx works. (source: lab, verified 2026-10-11)
