mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5286] [Question]: What is the absolute best inbound config for super smooth VLESS + XHTTP + TLS + CF? #3701
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#3701
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 @myothura on GitHub (Jun 13, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5286
What are you trying to do?
I am trying to achieve a highly stable, low-latency connection for streaming videos (like Facebook and YouTube) using VLESS + XHTTP + TLS behind Cloudflare Proxy (Orange Cloud).
Currently, the connection suffers from severe latency spikes and constant video buffering. Because of specific network constraints, I MUST use this exact combination (XHTTP + CF). I cannot switch to WebSockets, gRPC, or downgrade the panel/core.
I am looking for the optimal, "super smooth" inbound configuration. What are the exact recommended parameters (mode, xPaddingBytes, ALPN, etc.) for XHTTP in 3x-ui to completely eliminate stuttering and high ping when forced to route through Cloudflare?
What have you already tried?
packet-up(as suggested in related bug reports), but it still stutters heavily with Cloudflare.Despite all these tweaks, it is still not stable enough for normal video streaming.
3x-ui version
3.3.1
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 22.04 / 24.04
Screenshots or config snippets
Here is my current inbound configuration that is causing the lag. Please advise on exactly what values need to be changed here to achieve maximum stability through Cloudflare:
{
"network": "xhttp",
"security": "tls",
"tlsSettings": {
"serverName": "sunixai.com",
"alpn": [
"h2",
"http/1.1"
]
},
"xhttpSettings": {
"path": "/?=8443",
"host": "sunixai.com",
"mode": "packet-up",
"extra": {
"xPaddingBytes": "100-1000"
}
}
}
Before submitting
@github-actions[bot] commented on GitHub (Jun 13, 2026):
This question has two parts worth separating: what the 3x-ui panel does with your config, and where the CF+XHTTP performance problem actually lives.
What 3x-ui does with the XHTTP config
Confirmed in
internal/xray/process.go: the panel writes the inbound's stream settings verbatim into the xray-coreconfig.jsonwith no server-side transformation of XHTTP fields. All tuning knobs live entirely inside xray-core. The frontend form atfrontend/src/pages/inbounds/form/transport/xhttp.tsxis purely a UI wrapper that serializes values into the JSON blob stored in the database.A structural issue in your posted config
The config you shared nests
xPaddingBytesunder anextrasub-object:The 3x-ui panel does not define an
extrasub-object in its XHTTP schema (frontend/src/schemas/protocols/stream/xhttp.ts). When the panel generates a config,xPaddingBytesis emitted as a top-level field ofxhttpSettings, not insideextra. Theextrawrapper only appears in share-link URL parameters, not in the xray-core config JSON. If this is your actual stored inbound JSON (visible in the panel's JSON editor), xray-core v26.6.1 may be ignoring the padding value. Verify by opening the inbound edit form and checking whether the "Padding Bytes" field is populated.An untested panel field that is relevant to Cloudflare
The inbound XHTTP form exposes a
noSSEHeadertoggle ("No SSE Header",frontend/src/pages/inbounds/form/transport/xhttp.tsxlines 221–226). Its default isfalse, which means xray-core sends aContent-Type: text/event-streamSSE header on the download leg. Cloudflare is known to handle SSE streams differently from plain chunked HTTP responses — it may buffer or transform them in ways that introduce the latency you observe. SettingnoSSEHeader: truein the inbound XHTTP settings tells xray-core to omit that header, so Cloudflare sees the download as a regular HTTP/2 response. This is a server-only field (confirmed infrontend/src/lib/xray/inbound-link.tsline 33) that does not appear in client share links.Remaining tuning fields for
packet-upmode (all available in the panel form)scMaxEachPostBytes(default empty → xray uses 1 MB): a large POST body may be buffered or rejected by Cloudflare's edge. Try setting this to"200000"or"500000"to force smaller chunks.scMaxBufferedPosts(default 30): server-side buffer depth for unacknowledged POST chunks. Reducing this limits in-flight data.Where the root cause lives
You have already confirmed (in #5263) that the problem is specific to Cloudflare proxy mode and does not occur direct. The XHTTP connection behavior — chunking, flow control, connection reuse — is implemented entirely in xray-core, not in 3x-ui. Once you have ruled out the
noSSEHeaderandxPaddingBytesplacement issues above, any remaining incompatibility between XHTTP and Cloudflare's proxy is an upstream matter for the XTLS/Xray-core issue tracker, where the XHTTP transport is maintained.This reply was generated automatically; a maintainer may follow up.