Skip to content

Commit 06b44d9

Browse files
maxvpranbel
authored andcommitted
[Gateway] Proxy Happy Eyeballs algorithm (#19432)
Co-authored-by: ranbel <[email protected]>
1 parent 0737d5b commit 06b44d9

File tree

2 files changed

+43
-14
lines changed

2 files changed

+43
-14
lines changed

src/content/docs/cloudflare-one/connections/connect-devices/agentless/pac-files.mdx

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Only available on Enterprise plans.
1313

1414
You can apply Gateway HTTP and DNS policies at the browser level by configuring a Proxy Auto-Configuration (PAC) file.
1515

16-
<GlossaryDefinition term="PAC file" prepend="A PAC file is" />
16+
<GlossaryDefinition term="PAC file" prepend="A PAC file is " />
1717

1818
When end users visit a website, their browser will send the request to a Cloudflare proxy server associated with your account to be filtered by Gateway. Note that Gateway [cannot filter every type of HTTP traffic](#limitations) proxied using PAC files.
1919

@@ -215,19 +215,17 @@ To get the domain of a proxy endpoint:
215215
--header "Authorization: Bearer <API_TOKEN>"
216216
```
217217

218-
```json {10} output
218+
```json {8} output
219219
{
220-
"success": true,
221-
"result": {
222-
"id": "ed35569b41ce4d1facfe683550f54086",
223-
"created_at": "2014-01-01T05:20:00.12345Z",
224-
"ips": [
225-
"192.0.2.1/32"
226-
],
227-
"name": "DevOps team",
228-
"subdomain": "oli3n9zkz5.proxy.cloudflare-gateway.com",
229-
"updated_at": "2014-01-01T05:20:00.12345Z"
230-
}
220+
"success": true,
221+
"result": {
222+
"id": "ed35569b41ce4d1facfe683550f54086",
223+
"created_at": "2014-01-01T05:20:00.12345Z",
224+
"ips": ["192.0.2.1/32"],
225+
"name": "DevOps team",
226+
"subdomain": "oli3n9zkz5.proxy.cloudflare-gateway.com",
227+
"updated_at": "2014-01-01T05:20:00.12345Z"
228+
}
231229
}
232230
```
233231

src/content/docs/cloudflare-one/policies/gateway/proxy.mdx

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,38 @@ You can forward [HTTP](/cloudflare-one/policies/gateway/initial-setup/http/) and
1111

1212
The Gateway proxy is required for filtering HTTP and network traffic via the WARP client in Gateway with WARP mode. To proxy HTTP traffic without deploying the WARP client, you can configure [PAC files](/cloudflare-one/connections/connect-devices/agentless/pac-files/) on your devices.
1313

14-
## Proxy protocols
14+
## Proxy algorithm
15+
16+
Gateway uses the [Happy Eyeballs algorithm](https://datatracker.ietf.org/doc/html/rfc6555) to proxy traffic in the following order:
17+
18+
1. The user's browser initiates the TCP handshake by sending Gateway a TCP SYN segment.
19+
2. Gateway sends a SYN segment to the origin server.
20+
3. If the origin server sends a SYN-ACK segment back, Gateway establishes distinct TCP connections between the user and Gateway and between Gateway and the origin server.
21+
4. Gateway inspects and filters traffic received from the user.
22+
5. If the traffic passes inspection, Gateway proxies traffic bidirectionally between the user and the origin server.
23+
24+
```mermaid
25+
flowchart TD
26+
%% Accessibility
27+
accTitle: How Gateway proxy works
28+
accDescr: Flowchart describing how the Gateway proxy uses the Happy Eyeballs algorithm to establish TCP connections and proxy user traffic.
29+
30+
%% Flowchart
31+
A[User's device sends TCP SYN to Gateway] --> B[Gateway sends TCP SYN to origin server]
32+
B --> C{{Origin server responds with TCP SYN-ACK?}}
33+
C -->|Yes| E[TCP handshakes completed]
34+
C -->|No| D[Connection fails]
35+
E --> F{{Connection allowed?}}
36+
F -->|Yes| G[Gateway proxies traffic bidirectionally]
37+
F -->|No| H[Connection blocked by firewall policies]
38+
39+
%% Styling
40+
style D stroke:#D50000
41+
style G stroke:#00C853
42+
style H stroke:#D50000
43+
```
44+
45+
## Supported protocols
1546

1647
Gateway supports proxying TCP, UDP, and ICMP traffic.
1748

0 commit comments

Comments
 (0)