[GH-ISSUE #6371] [Bug]: it's not working if your IP is behind the CDN ( Cloudflare ) #4324

Closed
opened 2026-10-31 20:38:50 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @WikiHacker on GitHub (Aug 31, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6371

Describe the bug

it's not working if your IP is behind the CDN ( Cloudflare )
test with: VLESS, Port: 443, ( DNS name )

How to reproduce the problem

it's not working if your IP is behind the CDN ( Cloudflare )
test with: VLESS, Port: 443, ( DNS name )

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.7

Xray-core version

No response

How did you install 3x-ui?

install.sh script

Operating system

ubuntu 22

Which parts of the panel are affected?

No response

Browser (only if it is a UI bug)

No response

Is the panel behind a reverse proxy or CDN?

None

Before submitting

  • I searched existing issues and this bug has not been reported.
  • I am running the latest released version of 3x-ui (or have verified the bug still exists on it).
  • This bug report is written in English.
  • I have redacted any sensitive data (tokens, real domains, client UUIDs).
Originally created by @WikiHacker on GitHub (Aug 31, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6371 ### Describe the bug it's not working if your IP is behind the CDN ( Cloudflare ) test with: VLESS, Port: 443, ( DNS name ) ### How to reproduce the problem it's not working if your IP is behind the CDN ( Cloudflare ) test with: VLESS, Port: 443, ( DNS name ) ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.7 ### Xray-core version _No response_ ### How did you install 3x-ui? install.sh script ### Operating system ubuntu 22 ### Which parts of the panel are affected? _No response_ ### Browser (only if it is a UI bug) _No response_ ### Is the panel behind a reverse proxy or CDN? None ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this bug has not been reported. - [x] I am running the latest released version of 3x-ui (or have verified the bug still exists on it). - [x] This bug report is written in English. - [x] I have redacted any sensitive data (tokens, real domains, client UUIDs).
bsakaguchi 2026-10-31 20:38:50 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@github-actions[bot] commented on GitHub (Aug 31, 2026):

I can't confirm a panel defect from this report as written — but the most likely explanation is a transport mismatch, not a 3x-ui bug: Cloudflare's orange-cloud proxy only forwards HTTP(S), so a VLESS inbound on raw TCP (the panel's default) cannot pass through it, regardless of the port. Only the HTTP-shaped transports survive a CDN hop.

That is written down in the repo. docs/content/docs/en/config/transports.mdx:19-24:

| **TCP (Raw)**   | `tcpSettings`         | Lowest overhead. The basis for REALITY + XTLS-Vision and fallbacks; ...
| **WebSocket**   | `wsSettings`          | Works through CDNs and HTTP reverse proxies; very compatible.
| **HTTPUpgrade** | `httpupgradeSettings` | CDN-friendly HTTP/1.1 `Upgrade`; lighter than full WebSocket.
| **XHTTP**       | `xhttpSettings`       | Modern stream-multiplexed HTTP transport; CDN-friendly and REALITY-capable.

The same four transports are the ones the panel treats as CDN-capable in code, in frontend/src/pages/inbounds/form/transport/sockopt.tsx:19:

const TRUSTED_HEADER_NETWORKS = ['ws', 'httpupgrade', 'xhttp', 'grpc'];

Two consequences worth checking before anything else:

  1. Set the inbound's transport to ws, httpupgrade or xhttp (Transport tab of the inbound form) with security = tls. Raw TCP + TLS, and REALITY in particular, cannot work behind a proxied Cloudflare record — the CDN terminates TLS at its edge, so REALITY's whole handshake trick is gone.
  2. Front the inbound with a managed host rather than editing the inbound address, if you want the share link to point at the CDN hostname while the inbound keeps listening on the origin. The "Managed hosts" section of docs/content/docs/en/operations/multi-node.mdx names this exact case at line 78: "front an inbound through a CDN (Cloudflare) with a different address/SNI".

If you also want the real visitor IP recorded instead of Cloudflare's edge IP (needed for the IP-limit feature), the inbound's Real client IP → "Cloudflare CDN" preset in the sockopt section writes sockopt.trustedXForwardedFor for you (internal/web/translation/en-US.json:567, 572).

To go further than that I need details the form did not capture. Please add, as text (no screenshots):

  1. The inbound's transport and security — tcp/ws/grpc/httpupgrade/xhttp, and none/tls/reality. This is the single field that decides whether the report is a bug at all.
  2. What "not working" actually means — the exact error the client app shows, or the relevant lines from the Xray log (x-ui menu → logs). The report has an empty log block.
  3. Your Xray-core version (panel → Xray settings). Left blank on the form.
  4. The Cloudflare side: is the DNS record proxied (orange cloud) or DNS-only (grey cloud), and which SSL/TLS encryption mode is set (Flexible / Full / Full strict)?

One inconsistency to clear up while you're at it: the form's "Is the panel behind a reverse proxy or CDN?" is answered None, which contradicts the title. Please confirm whether it is the panel that sits behind Cloudflare, or only the proxy inbound.

Verdict: Insufficient information
Severity: N/A
Confidence: Medium
Root cause: None identified — the report names no panel behaviour, no transport, no error text and no log line, so there is no code path to trace. The stated symptom is consistent with a CDN-incompatible transport (raw TCP or REALITY behind a proxied Cloudflare record), which is a configuration outcome the panel documents rather than a defect.
Already fixed: Not applicable. The reporter is on 3.7, which gh release list shows as the latest release (v3.7.0, 2026-08-24).
Duplicate of: None. Related: #3913 ("VLESS + WS + TLS not working correctly behind Cloudflare", closed) and #5498 ("Client IP logging behind Cloudflare stopped working after updating Xray Core to v26.6.22", closed) — neither has a confirmed shared root cause with this report.
Evidence: docs/content/docs/en/config/transports.mdx:21 "WebSocket | wsSettings | Works through CDNs and HTTP reverse proxies; very compatible."; docs/content/docs/en/config/transports.mdx:19 lists TCP (Raw) with no CDN capability; frontend/src/pages/inbounds/form/transport/sockopt.tsx:19 const TRUSTED_HEADER_NETWORKS = ['ws', 'httpupgrade', 'xhttp', 'grpc'];; frontend/src/pages/inbounds/form/transport/sockopt.tsx:16-18 "Transports on which xray-core honors sockopt.trustedXForwardedFor. gRPC joined in v26.6.22"; docs/content/docs/en/operations/multi-node.mdx:78 "front an inbound through a CDN (Cloudflare) with a different address/SNI"; internal/web/translation/en-US.json:567 "Only honored on WebSocket, HTTPUpgrade, XHTTP and gRPC transports."
Not determined: Whether any panel code is involved at all. The inbound's transport + security values (item 1 above) settle it: with ws/httpupgrade/xhttp + tls failing behind Cloudflare there is something to investigate; with tcp or reality there is not.

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:5474747726 --> @github-actions[bot] commented on GitHub (Aug 31, 2026): I can't confirm a panel defect from this report as written — but the most likely explanation is a transport mismatch, not a 3x-ui bug: **Cloudflare's orange-cloud proxy only forwards HTTP(S), so a VLESS inbound on raw TCP (the panel's default) cannot pass through it, regardless of the port.** Only the HTTP-shaped transports survive a CDN hop. That is written down in the repo. `docs/content/docs/en/config/transports.mdx:19-24`: ``` | **TCP (Raw)** | `tcpSettings` | Lowest overhead. The basis for REALITY + XTLS-Vision and fallbacks; ... | **WebSocket** | `wsSettings` | Works through CDNs and HTTP reverse proxies; very compatible. | **HTTPUpgrade** | `httpupgradeSettings` | CDN-friendly HTTP/1.1 `Upgrade`; lighter than full WebSocket. | **XHTTP** | `xhttpSettings` | Modern stream-multiplexed HTTP transport; CDN-friendly and REALITY-capable. ``` The same four transports are the ones the panel treats as CDN-capable in code, in `frontend/src/pages/inbounds/form/transport/sockopt.tsx:19`: ```ts const TRUSTED_HEADER_NETWORKS = ['ws', 'httpupgrade', 'xhttp', 'grpc']; ``` Two consequences worth checking before anything else: 1. **Set the inbound's transport to `ws`, `httpupgrade` or `xhttp`** (Transport tab of the inbound form) with **security = `tls`**. Raw TCP + TLS, and REALITY in particular, cannot work behind a proxied Cloudflare record — the CDN terminates TLS at its edge, so REALITY's whole handshake trick is gone. 2. **Front the inbound with a managed host rather than editing the inbound address**, if you want the share link to point at the CDN hostname while the inbound keeps listening on the origin. The "Managed hosts" section of [`docs/content/docs/en/operations/multi-node.mdx`](https://github.com/MHSanaei/3x-ui/blob/main/docs/content/docs/en/operations/multi-node.mdx) names this exact case at line 78: "front an inbound through a **CDN** (Cloudflare) with a different address/SNI". If you also want the real visitor IP recorded instead of Cloudflare's edge IP (needed for the IP-limit feature), the inbound's **Real client IP → "Cloudflare CDN"** preset in the sockopt section writes `sockopt.trustedXForwardedFor` for you (`internal/web/translation/en-US.json:567`, `572`). To go further than that I need details the form did not capture. Please add, as text (no screenshots): 1. **The inbound's transport and security** — `tcp`/`ws`/`grpc`/`httpupgrade`/`xhttp`, and `none`/`tls`/`reality`. This is the single field that decides whether the report is a bug at all. 2. **What "not working" actually means** — the exact error the client app shows, or the relevant lines from the Xray log (`x-ui` menu → logs). The report has an empty log block. 3. **Your Xray-core version** (panel → Xray settings). Left blank on the form. 4. **The Cloudflare side**: is the DNS record proxied (orange cloud) or DNS-only (grey cloud), and which SSL/TLS encryption mode is set (Flexible / Full / Full strict)? One inconsistency to clear up while you're at it: the form's "Is the panel behind a reverse proxy or CDN?" is answered **None**, which contradicts the title. Please confirm whether it is the *panel* that sits behind Cloudflare, or only the *proxy inbound*. Verdict: Insufficient information Severity: N/A Confidence: Medium Root cause: None identified — the report names no panel behaviour, no transport, no error text and no log line, so there is no code path to trace. The stated symptom is consistent with a CDN-incompatible transport (raw TCP or REALITY behind a proxied Cloudflare record), which is a configuration outcome the panel documents rather than a defect. Already fixed: Not applicable. The reporter is on 3.7, which `gh release list` shows as the latest release (v3.7.0, 2026-08-24). Duplicate of: None. Related: #3913 ("VLESS + WS + TLS not working correctly behind Cloudflare", closed) and #5498 ("Client IP logging behind Cloudflare stopped working after updating Xray Core to v26.6.22", closed) — neither has a confirmed shared root cause with this report. Evidence: `docs/content/docs/en/config/transports.mdx:21` "**WebSocket** | `wsSettings` | Works through CDNs and HTTP reverse proxies; very compatible."; `docs/content/docs/en/config/transports.mdx:19` lists TCP (Raw) with no CDN capability; `frontend/src/pages/inbounds/form/transport/sockopt.tsx:19` `const TRUSTED_HEADER_NETWORKS = ['ws', 'httpupgrade', 'xhttp', 'grpc'];`; `frontend/src/pages/inbounds/form/transport/sockopt.tsx:16-18` "Transports on which xray-core honors sockopt.trustedXForwardedFor. gRPC joined in v26.6.22"; `docs/content/docs/en/operations/multi-node.mdx:78` "front an inbound through a **CDN** (Cloudflare) with a different address/SNI"; `internal/web/translation/en-US.json:567` "Only honored on WebSocket, HTTPUpgrade, XHTTP and gRPC transports." Not determined: Whether any panel code is involved at all. The inbound's transport + security values (item 1 above) settle it: with `ws`/`httpupgrade`/`xhttp` + `tls` failing behind Cloudflare there is something to investigate; with `tcp` or `reality` there is not. *This reply was generated automatically; a maintainer may follow up.* <!-- claude-issue:analyst -->
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#4324
No description provided.