# Cloudflare Gateway PAC builder

Source: https://findproxyforurl.net/generate/sse/cloudflare/ · last updated 2026-10-15

Cloudflare's templates are a good base: correct RFC 1918 masks, loopback as a /8, lower-cased host,
IdP bypass first. Two things are changed here. The private-network test is guarded by an IP-literal
check instead of calling `dnsResolve(host)` for every request (one DNS dependency is qualitatively
different from none), and the `*.local` bypass is optional because some networks still use `.local`
as an internal DNS suffix.

## One keyword and one port decide whether the endpoint answers

The pack list further down names each check. These are the reasons behind the ones that break a
Cloudflare Gateway PAC file most often (source: doc, Cloudflare documentation as cited on each rule
page, October 2026):

- **`HTTPS`, not `PROXY`.** The proxy endpoint only accepts a TLS connection from the browser. A
  `PROXY` entry for the same host makes the browser speak plain HTTP to it, and that never connects
  ([rule](https://findproxyforurl.net/rules/cloudflare-gateway-endpoint-needs-https-keyword/)).
- **Port 443 only.** Every Cloudflare example uses 443, and other ports do not answer
  ([rule](https://findproxyforurl.net/rules/cloudflare-gateway-endpoint-port/)).
- **Clients without `HTTPS` support need another path.** Safari and iOS/iPadOS cannot use an
  `HTTPS` proxy from a PAC file, so their traffic does not reach Gateway through this file
  ([rule](https://findproxyforurl.net/rules/https-proxy-keyword-without-fallback/)). On Windows, Chrome, Edge, Firefox and
  programs that use the Windows network libraries WinHTTP and WinINet open the TLS connection to the
  proxy and send their requests inside it (lab, Windows 11, October 2026). Programs built on the older
  .NET Framework do not, so check such tools separately.
- **Local traffic has to go direct in the file itself.** Plain host names and private addresses
  cannot be reached through a cloud proxy, so the file sends them `DIRECT` before the default
  route, without DNS lookups ([rule](https://findproxyforurl.net/rules/sse-local-traffic-not-bypassed/),
  [DNS in PAC files](https://findproxyforurl.net/articles/dns-in-pac-files/)).

To check an existing file against all of this, paste it into the [PAC file tester](https://findproxyforurl.net/check/) and
choose Cloudflare under **Environment**.

