# No FindProxyForURL function

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

Rule PAC-E002 (`missing-findproxyforurl`), severity critical, category: Errors and robustness.

The file parses but defines no function called exactly FindProxyForURL. Engines bind by that exact, case-sensitive name; nothing else is called.

## Why it matters

Engines look up a global function named `FindProxyForURL` (case-sensitive) and call it for
every request. `findProxyForUrl`, `FindProxyForUrl` or `findproxyforurl` are ordinary,
unused functions. The result is the same as a parse error: the engine reports a script
failure and the client goes DIRECT.

The PAC v2 entry point `FindProxyForURLEx` is only honoured by WinHTTP-based clients
(see PAC-K004); a file that defines only the Ex form is also missing the standard entry
point for Chromium and Firefox.


## How to fix

Rename the function to FindProxyForURL (capital F, P, F, URL).

## Bad

```js
function findProxyForUrl(url, host) {
  return "DIRECT";
}
```

## Good

```js
function FindProxyForURL(url, host) {
  return "DIRECT";
}
```

## Engine behaviour

- chromium: FindProxyForURL is required; its absence is a script error and connections go DIRECT. (source: code, verified 2026-10-04)
- winhttp: A file whose function is spelled findProxyForURL fails with an error to the calling program. A file that defines only FindProxyForURLEx works. (source: lab, verified 2026-10-11)
