mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6839] [Feature]: Support dynamic DoH format in echConfigList and explain/warn about CDN incompatibility for local generated keys #4551
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#4551
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 @55575455 on GitHub (Oct 15, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6839
Is your feature request related to a problem?
When configuring Inbound TLS with ECH enabled in 3X-UI, the panel currently provides a button to automatically generate a local ECH keypair (storing the private key in Xray config and outputting the base64 public key to
echConfigList).However, for users proxying traffic through Cloudflare CDN (e.g., using VLESS + xhttp / WebSocket with orange-cloud enabled):
Describe the solution you'd like
Support Dynamic DoH Resolver Format in
echConfigList:<Target_Domain>+<DoH_URL>(e.g.,
cloudflare-ech.com+https://dns.alidns.com/dns-queryorcloudflare-ech.com+https://1.1.1.1/dns-query).+and URLs inechConfigList.Add a Preset / Helper for Cloudflare Users:
UI Tooltip / Clarification:
Describe alternatives you've considered
Currently, users have to manually edit every exported link or client config profile (e.g. in v2rayN or mobile apps) to replace the panel-generated base64 string with
cloudflare-ech.com+https://dns.alidns.com/dns-query. This causes significant friction and breaks standard subscription update flows.Additional context
With Cloudflare xhttp becoming a dominant transport protocol to mitigate active probing and SNI blocking, having seamless dynamic ECH support out of the box will significantly improve usability for users utilizing CDN networks.
Describe the solution you'd like
Describe the solution you'd like
We propose a multi-level improvement covering UI validation, dynamic presets, and link export logic:
Relax Input Validation on
echConfigList:<Domain>+<DoH_URL>(allowing characters like+,:,/, and query strings?), instead of strictly enforcing standard Base64 encoding.Add a "Cloudflare Dynamic ECH" Preset / Toggle:
cloudflare-ech.com+https://dns.alidns.com/dns-query(AliDNS)cloudflare-ech.com+https://sm2.doh.pub/dns-query(DNSPod / Tencent)cloudflare-ech.com+https://cloudflare-dns.com/dns-query(Cloudflare)Export & Subscription Link Support:
echConfigListstring in the URL parameters (e.g.,&echConfigList=cloudflare-ech.com%2Bhttps%3A%2F%2Fdns.alidns.com%2Fdns-queryor plaintext+where compliant), allowing clients like v2rayN, Sing-box, and mobile apps to directly ingest it without manual intervention.UI Guidance & Tooltips:
Alternatives you've considered
No response
Concrete use case
No response
Mockups, screenshots, or examples
Key Value & Real-world Use Case: Complete SNI + Origin IP Masking
By combining Cloudflare CDN with dynamic DoH ECH, users achieve full-path obfuscation against DPI and censorship:
Unblocking Banned/Censored Domains:
Default subdomains like
*.pages.devor*.workers.devare heavily blocked by SNI-based RST/resets in strict network environments. With ECH enabled, the real SNI (Inner SNI) is fully encrypted inside the TLS handshake. The middlebox only observes the harmless outer SNI (cloudflare-ech.com), effectively bypassing SNI filtering and reviving otherwise blocked domains without needing clean custom domains.Dual-Layer Hiding (IP + SNI):
104.17.17.181) hides the VPS server's true IP.Maintenance-Free Connection:
Because Cloudflare regularly rotates its public ECH keys, standard static Base64 keys break within days. Supporting the dynamic syntax (
domain+doh) ensures the connection stays alive long-term without requiring users to constantly re-extract and replace keys manually.Which parts of the panel would this affect?
No response
Are you willing to help?
Before submitting
@55575455 commented on GitHub (Oct 15, 2026):
Real-world Case: Reviving Blocked Custom Domains & True Zero-Knowledge Transport
To illustrate why this feature is critical, here is a practical scenario from actual deployment on a self-owned VPS (not limited to pages.dev):
1. Reviving Blocked / Dirty Custom Domains
Many low-cost domains (such as cheap numeric
.xyzdomains) are already blocked by SNI filtering right upon purchase, or get blocked shortly after.Inner SNI. Censors only observe the harmless, sharedOuter SNI(cloudflare-ech.com).2. Three-Layer Privacy & Obfuscation (IP + SNI + Payload)
Combining Cloudflare CDN + Dynamic ECH + VLESS Encryption establishes a complete zero-knowledge security chain:
Summary
This workflow isn't just a workaround for Pages—it is an essential, highly cost-effective survival architecture for users deploying custom domains and self-hosted VPS servers in heavily censored network regions. Providing seamless Dynamic DoH input and export in 3X-UI will make this setup accessible to everyone without tedious manual config hacking.
@55575455 commented on GitHub (Oct 15, 2026):
@MHSanaei commented on GitHub (Oct 16, 2026):
@claude analyze
@github-actions[bot] commented on GitHub (Oct 16, 2026):
Most of this already works on the current default branch. The panel does not validate the ECH field, so it accepts the
<domain>+<DoH URL>form, and every link and subscription builder passes the value to clients unchanged. Two things are missing: a "Cloudflare dynamic ECH" preset and a hint that the generated key is for direct connections only. Those are the actual feature request here.This is the first analysis on this thread. I could not open the screenshot in the last comment. If it shows an error, please paste the text.
What already works
+,:or/. The inbound TLS form's ECH config field is a plain<Input />with norules(frontend/src/pages/inbounds/form/security/tls.tsx:361-366), and its schema is justechConfigList: z.string().default('')(frontend/src/schemas/protocols/security/tls.ts:85). The Go side has no check on it either.internal/sub/service.go:1452-1455). Query strings are built withurl.Values(internal/sub/service.go:2335), so+becomes%2Band the client decodes it back. The JSON subscription writes it totlsSettings.echConfigList(internal/sub/json_service.go:807-808). The in-panel links do the same withparams.set('ech', …)infrontend/src/lib/xray/inbound-link.ts:474,578,819.TestSub_HostTLSVerificationJSONAtXrayLevel(internal/sub/host_sub_test.go:624) storesEchConfigList: "cloudflare-ech.com+udp://1.1.1.1"on a Host and checks that the JSON subscription emits exactly that string.How to set up the Cloudflare CDN case today
Use a Host for the CDN endpoint. Hosts have their own ECH config list field (
frontend/src/pages/hosts/HostFormModal.tsx:361-366), which replaces the inbound's value for that one link (internal/sub/service.go:2095-2096,2168-2174):tls.That way direct links and CDN links each get the ECH value that fits them. Nothing needs editing on the client side, and a subscription refresh keeps the value.
What is not there
useSecurityActions.ts:190-198), which fills both the key and the config list from a locally generated keypair."echKey": "ECH key"and"echConfig": "ECH config"(internal/web/translation/en-US.json:613-614). A tooltip there would be a small, self-contained change.Related
#4934 asked the panel to fetch Cloudflare's ECH config automatically. It was closed as out of scope because that would tie the panel to a Cloudflare API or DNS lookup. This request is different: the
domain+DoHstring is static, and the client resolves it. Whether to add a preset is the maintainer's call.Verdict: Feature request. Input and export of the DoH form already work. The open parts are the preset/toggle and the guidance tooltip.
This reply was generated automatically; a maintainer may follow up.
@55575455 commented on GitHub (Oct 17, 2026):
Clarification and Proposed Implementation
After reviewing the existing implementation, I would like to clarify the main goal of this feature request.
The issue is not simply whether Xray can support Dynamic ECH. The underlying
echConfigListfield already accepts and exports the dynamic format:For example:
The missing piece is that Dynamic ECH is not exposed as a first-class, selectable configuration mode in the 3x-ui UI. Users currently need to know the Xray-specific syntax and manually enter it into
echConfigList. I believe this functionality should be easier to discover, configure, and use.1. Distinguish local ECH from CDN ECH
There are two fundamentally different deployment scenarios.
Direct connection to an Xray server:
Here, Xray terminates the TLS connection. Generating a local ECH keypair is appropriate because Xray controls the TLS endpoint.
Connection through Cloudflare CDN:
In this case, Cloudflare terminates the client-facing TLS connection. The ECH configuration generated locally by Xray is not the ECH configuration published by Cloudflare for that connection.
Instead, the client needs Cloudflare's published ECH configuration, which can be retrieved dynamically through DNS-over-HTTPS (DoH).
For example:
This distinction is not sufficiently clear when the UI presents local ECH key generation as the primary configuration workflow. Users may configure Cloudflare CDN, generate a local ECH keypair, and mistakenly assume that the resulting configuration is suitable for the CDN-facing TLS connection.
2. Expose Dynamic ECH as a selectable mode
I propose adding a clear mode selector to the ECH configuration interface, for example:
When Dynamic ECH is selected, the UI could expose the following fields:
The values above are examples. The panel should preserve the existing ability to configure the underlying
echConfigListdirectly, where appropriate, so that advanced users are not restricted to predefined settings.The distinction is important:
Backend compatibility with Dynamic ECH does not mean Dynamic ECH is available as a user-selectable feature in the panel.
My request is primarily about making the existing capability accessible through a proper UI workflow, rather than reimplementing functionality that Xray already supports.
3. Make the DoH resolver configurable
The reason I chose AliDNS in the example is practical.
For users connecting from mainland China, many commonly used overseas DoH resolvers may be blocked, unreliable, or otherwise inaccessible due to network restrictions and interference. Consequently, a Dynamic ECH configuration can fail to retrieve the required DNS information even when the Xray implementation itself supports Dynamic ECH.
A configurable DoH endpoint would allow users to select a resolver that is reachable and reliable in their own network environment.
AliDNS is only an example, not a requirement. Users in other regions should be able to use other compatible resolvers.
The ECH domain and the DoH resolver serve different purposes:
I would therefore prefer a configurable resolver field instead of hardcoding a single DoH provider. This would also avoid unnecessarily coupling the implementation to a specific DNS service.
4. Keep the implementation simple
I do not think this feature necessarily requires Cloudflare API integration or a separate key-management system in 3x-ui.
If the existing Xray configuration, subscription-generation, and sharing-link mechanisms already support the dynamic
domain+DoH_URLformat, they can remain unchanged.The main improvements would be:
This would make Dynamic ECH a properly supported user-facing feature without duplicating functionality already provided by Xray.
Summary
My main request is to make Dynamic ECH a first-class option in 3x-ui, with a configurable DoH resolver and clear guidance on when to use local ECH versus CDN ECH.
The existing backend may already support the necessary configuration format, but users should not have to discover an undocumented syntax and manually enter it to use a feature that is particularly relevant to CDN-based deployments.
I believe this would be a relatively small UI improvement with a meaningful impact on usability, especially for users whose network environments require a specific DoH resolver.
@55575455 commented on GitHub (Oct 17, 2026):
Clarification
Thanks for the analysis. I think the current implementation confirms what I was trying to address.
I agree that the underlying Xray configuration and subscription/export mechanisms already support the Dynamic ECH format:
For example:
So I don't think this requires a major backend implementation.
The main thing I would like to see is Dynamic ECH exposed as an actual selectable option in the 3x-ui UI.
Currently, the UI allows users to generate a local ECH keypair, but there is no corresponding option such as:
This distinction is important for Cloudflare CDN users.
With a direct connection:
a locally generated ECH keypair makes sense because Xray is the TLS endpoint.
But with:
Cloudflare is the client-facing TLS endpoint. Therefore, the ECH configuration generated by Xray locally is not the ECH configuration that the client should use for Cloudflare.
In this case, the client should dynamically obtain Cloudflare's published ECH configuration, for example:
So the problem isn't that Xray cannot do Dynamic ECH. The problem is that 3x-ui currently doesn't present Dynamic ECH as a first-class configuration option.
I would also strongly prefer the DoH resolver to remain configurable rather than hardcoded.
I used AliDNS in the example because this is particularly relevant for users in mainland China. Many commonly used overseas DoH services can be blocked, interfered with, or simply unreliable from that network environment. A Dynamic ECH implementation is only useful if the client can actually reach the configured DoH resolver.
Therefore, something as simple as:
would already solve most of the usability problem.
No Cloudflare API integration or separate ECH key management should be necessary if the existing Xray configuration and subscription mechanisms can already handle the
domain+DoH_URLformat.In short, I am mainly proposing a UI/UX improvement around an already-supported Xray feature, rather than asking 3x-ui to implement Dynamic ECH from scratch.