[GH-ISSUE #5286] [Question]: What is the absolute best inbound config for super smooth VLESS + XHTTP + TLS + CF? #3701

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

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?

  • Upgraded panel to 3.3.1 (bundled core v26.6.1).
  • Client side is strictly using Xray-core v26.3.27.
  • Disabled 'smux' completely on the client side.
  • Tested changing the XHTTP mode to packet-up (as suggested in related bug reports), but it still stutters heavily with Cloudflare.
  • Tested without Cloudflare (Grey-cloud), which is perfectly smooth, confirming the issue is the CF + XHTTP interaction.
  • Adjusted ALPN to prioritize "h2".
    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

  • I read the Wiki and searched existing issues.
  • This is a usage question, not a bug report.
  • This question is written in English.
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? - Upgraded panel to 3.3.1 (bundled core v26.6.1). - Client side is strictly using Xray-core v26.3.27. - Disabled 'smux' completely on the client side. - Tested changing the XHTTP mode to `packet-up` (as suggested in related bug reports), but it still stutters heavily with Cloudflare. - Tested without Cloudflare (Grey-cloud), which is perfectly smooth, confirming the issue is the CF + XHTTP interaction. - Adjusted ALPN to prioritize "h2". 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 - [x] I read the [Wiki](https://github.com/MHSanaei/3x-ui/wiki) and searched [existing issues](../issues?q=is%3Aissue). - [x] This is a usage question, not a bug report. - [x] This question is written in English.
bsakaguchi 2026-10-31 20:34:21 +07:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@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-core config.json with no server-side transformation of XHTTP fields. All tuning knobs live entirely inside xray-core. The frontend form at frontend/src/pages/inbounds/form/transport/xhttp.tsx is 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 xPaddingBytes under an extra sub-object:

"extra": {
  "xPaddingBytes": "100-1000"
}

The 3x-ui panel does not define an extra sub-object in its XHTTP schema (frontend/src/schemas/protocols/stream/xhttp.ts). When the panel generates a config, xPaddingBytes is emitted as a top-level field of xhttpSettings, not inside extra. The extra wrapper 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 noSSEHeader toggle ("No SSE Header", frontend/src/pages/inbounds/form/transport/xhttp.tsx lines 221–226). Its default is false, which means xray-core sends a Content-Type: text/event-stream SSE 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. Setting noSSEHeader: true in 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 in frontend/src/lib/xray/inbound-link.ts line 33) that does not appear in client share links.

Remaining tuning fields for packet-up mode (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 noSSEHeader and xPaddingBytes placement 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.

<!-- gh-comment-id:4699001969 --> @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-core `config.json` with no server-side transformation of XHTTP fields. All tuning knobs live entirely inside xray-core. The frontend form at `frontend/src/pages/inbounds/form/transport/xhttp.tsx` is 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 `xPaddingBytes` under an `extra` sub-object: ```json "extra": { "xPaddingBytes": "100-1000" } ``` The 3x-ui panel does not define an `extra` sub-object in its XHTTP schema (`frontend/src/schemas/protocols/stream/xhttp.ts`). When the panel generates a config, `xPaddingBytes` is emitted as a **top-level field** of `xhttpSettings`, not inside `extra`. The `extra` wrapper 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 `noSSEHeader` toggle ("No SSE Header", `frontend/src/pages/inbounds/form/transport/xhttp.tsx` lines 221–226). Its default is `false`, which means xray-core sends a `Content-Type: text/event-stream` SSE 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. Setting `noSSEHeader: true` in 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 in `frontend/src/lib/xray/inbound-link.ts` line 33) that does not appear in client share links. **Remaining tuning fields for `packet-up` mode (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 `noSSEHeader` and `xPaddingBytes` placement issues above, any remaining incompatibility between XHTTP and Cloudflare's proxy is an upstream matter for the [XTLS/Xray-core](https://github.com/XTLS/Xray-core/issues) issue tracker, where the XHTTP transport is maintained. *This reply was generated automatically; a maintainer may follow up.*
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#3701
No description provided.