# Cloudflare Gateway proxy endpoint with PROXY instead of HTTPS

Source: https://findproxyforurl.net/rules/cloudflare-gateway-endpoint-needs-https-keyword/ · last updated 2026-10-04

Rule PAC-C027 (`cloudflare-gateway-endpoint-needs-https-keyword`), severity high, category: Correctness.

Cloudflare Gateway proxy endpoints only accept TLS from the browser. The PAC must return "HTTPS <subdomain>.proxy.cloudflare-gateway.com:443"; "PROXY ..." to the same host fails for every request and the browser falls through to the next entry or to an error.

## Why it matters

Cloudflare's PAC best practices spell this out as the first formatting rule: "Make sure the directive
used for the endpoint is HTTPS and not PROXY", with `return "HTTPS your-subdomain.proxy.cloudflare-gateway.com:443";`
as the correct and the `PROXY` form as the incorrect example. `HTTPS host:port` means the hop from
browser to proxy is TLS; `PROXY host:port` means plain HTTP CONNECT. The endpoint has no plain-HTTP
listener, so the `PROXY` form is a connection that never completes. This is specific to TLS-terminating
gateways. For a typical on-premises forward proxy the opposite holds (see PAC-K006), which is why the
checker only applies this rule when the Cloudflare pack is selected and the host is a
proxy.cloudflare-gateway.com name.


## How to fix

Change the keyword to HTTPS and keep port 443, e.g. return "HTTPS abc123def0.proxy.cloudflare-gateway.com:443";

## Bad

```js
function FindProxyForURL(url, host) {
  if (isPlainHostName(host)) {
    return "DIRECT";
  }
  return "PROXY abc123def0.proxy.cloudflare-gateway.com:443";
}
```

## Good

```js
function FindProxyForURL(url, host) {
  if (isPlainHostName(host)) {
    return "DIRECT";
  }
  return "HTTPS abc123def0.proxy.cloudflare-gateway.com:443";
}
```

## Engine behaviour

- chromium: "HTTPS host:port" opens TLS to the proxy; accepted PAC keyword. (source: doc, verified 2026-10-04)
- firefox: Supports the HTTPS proxy type through a PAC file (Cloudflare lists Firefox as supported). (source: doc, verified 2026-10-04)
- macos-cfnetwork: Safari and iOS/iPadOS do not support the HTTPS proxy type required by proxy endpoints. (source: doc, verified 2026-10-04)
