mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6371] [Bug]: it's not working if your IP is behind the CDN ( Cloudflare ) #4324
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#4324
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
@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: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:Two consequences worth checking before anything else:
ws,httpupgradeorxhttp(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.docs/content/docs/en/operations/multi-node.mdxnames 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.trustedXForwardedForfor 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):
tcp/ws/grpc/httpupgrade/xhttp, andnone/tls/reality. This is the single field that decides whether the report is a bug at all.x-uimenu → logs). The report has an empty log block.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 listshows 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:19lists TCP (Raw) with no CDN capability;frontend/src/pages/inbounds/form/transport/sockopt.tsx:19const 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+tlsfailing behind Cloudflare there is something to investigate; withtcporrealitythere is not.This reply was generated automatically; a maintainer may follow up.