[GH-ISSUE #5109] [Feature]: CDN Fronting Config Generator #3590

Closed
opened 2026-10-31 20:33:33 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @saeedhasani on GitHub (Jun 9, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5109

Summary

I would like to propose a new feature that simplifies the generation of CDN-fronted client configuration links.

Many deployments operate behind a CDN such as Cloudflare, where users connect to a CDN edge IP while preserving the original Host and SNI values. Currently, administrators must manually create these alternative configuration links by replacing the connection endpoint with CDN edge IP addresses.

This process becomes repetitive and time-consuming when multiple CDN edge IPs are used.

Problem

A standard client configuration link is typically generated using the server's actual endpoint:

vless://uuid@my-server-address:2053?host=example.com&sni=example.com

To make the configuration work through a CDN frontend, administrators often create additional versions of the same configuration by replacing only the connection endpoint with CDN edge IPs while keeping all routing-related parameters unchanged.

Example:

vless://uuid@cloudflare-ip-1:2053?host=example.com&sni=example.com
vless://uuid@cloudflare-ip-2:2053?host=example.com&sni=example.com
vless://uuid@cloudflare-ip-3:2053?host=example.com&sni=example.com

Currently, these alternative configuration links must be generated manually or through external tools.

Describe the solution you'd like

Proposed Solution

Add a dedicated "CDN Fronting" section to the panel that allows administrators to:

  • Enter one or more frontend IP addresses.
  • Generate CDN-fronted versions of existing client configuration links.
  • Preserve all original configuration parameters, including Host, SNI, Path, Security settings, Transport settings, and Client IDs.
  • Replace only the connection endpoint with the specified frontend IP addresses.

For example:

Input frontend IP list:

cloudflare-ip-1
cloudflare-ip-2
cloudflare-ip-3

Generated result:

Config A → cloudflare-ip-1
Config B → cloudflare-ip-2
Config C → cloudflare-ip-3

Each generated configuration would remain functionally identical to the original configuration, with only the frontend endpoint changed.

Suggested UI Design

Instead of placing this functionality inside the Clients section, it may be more appropriate to provide a separate "CDN Fronting" tab or utility page.

Possible workflow:

  1. Select an existing client configuration.
  2. Enter one or more frontend IP addresses.
  3. Generate CDN-fronted configuration links.
  4. Copy or export the generated links.

This keeps the client management interface clean while providing a dedicated tool for administrators who use CDN-based deployments.

Benefits

  • Eliminates repetitive manual editing of configuration links.
  • Reduces human error.
  • Simplifies CDN-based deployments.
  • Works with Cloudflare and any other CDN or frontend infrastructure.
  • Preserves full compatibility with existing configurations.
  • Requires no changes to server-side routing logic.

Additional Notes

Although Cloudflare is one of the most common use cases, the feature should remain provider-agnostic. Any frontend IP address should be accepted, allowing administrators to use the functionality with Cloudflare, reverse proxies, edge networks, CDN providers, or other frontend infrastructures.

The purpose of this feature is simply to generate alternative client configuration links that expose configurable frontend endpoints while preserving the original domain-based routing configuration.

Alternatives you've considered

No response

Concrete use case

No response

Mockups, screenshots, or examples

No response

Which parts of the panel would this affect?

No response

Are you willing to help?

  • I'd like to implement this feature myself and open a PR.
  • I can help test once a PR is open.

Before submitting

  • I searched existing issues and this feature has not been requested.
  • This feature request is written in English.
Originally created by @saeedhasani on GitHub (Jun 9, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5109 ### Is your feature request related to a problem? ## Summary I would like to propose a new feature that simplifies the generation of CDN-fronted client configuration links. Many deployments operate behind a CDN such as Cloudflare, where users connect to a CDN edge IP while preserving the original Host and SNI values. Currently, administrators must manually create these alternative configuration links by replacing the connection endpoint with CDN edge IP addresses. This process becomes repetitive and time-consuming when multiple CDN edge IPs are used. ## Problem A standard client configuration link is typically generated using the server's actual endpoint: ```text vless://uuid@my-server-address:2053?host=example.com&sni=example.com ``` To make the configuration work through a CDN frontend, administrators often create additional versions of the same configuration by replacing only the connection endpoint with CDN edge IPs while keeping all routing-related parameters unchanged. Example: ```text vless://uuid@cloudflare-ip-1:2053?host=example.com&sni=example.com ``` ```text vless://uuid@cloudflare-ip-2:2053?host=example.com&sni=example.com ``` ```text vless://uuid@cloudflare-ip-3:2053?host=example.com&sni=example.com ``` Currently, these alternative configuration links must be generated manually or through external tools. ### Describe the solution you'd like ## Proposed Solution Add a dedicated "CDN Fronting" section to the panel that allows administrators to: * Enter one or more frontend IP addresses. * Generate CDN-fronted versions of existing client configuration links. * Preserve all original configuration parameters, including Host, SNI, Path, Security settings, Transport settings, and Client IDs. * Replace only the connection endpoint with the specified frontend IP addresses. For example: Input frontend IP list: ```text cloudflare-ip-1 cloudflare-ip-2 cloudflare-ip-3 ``` Generated result: ```text Config A → cloudflare-ip-1 Config B → cloudflare-ip-2 Config C → cloudflare-ip-3 ``` Each generated configuration would remain functionally identical to the original configuration, with only the frontend endpoint changed. ## Suggested UI Design Instead of placing this functionality inside the Clients section, it may be more appropriate to provide a separate "CDN Fronting" tab or utility page. Possible workflow: 1. Select an existing client configuration. 2. Enter one or more frontend IP addresses. 3. Generate CDN-fronted configuration links. 4. Copy or export the generated links. This keeps the client management interface clean while providing a dedicated tool for administrators who use CDN-based deployments. ## Benefits * Eliminates repetitive manual editing of configuration links. * Reduces human error. * Simplifies CDN-based deployments. * Works with Cloudflare and any other CDN or frontend infrastructure. * Preserves full compatibility with existing configurations. * Requires no changes to server-side routing logic. ## Additional Notes Although Cloudflare is one of the most common use cases, the feature should remain provider-agnostic. Any frontend IP address should be accepted, allowing administrators to use the functionality with Cloudflare, reverse proxies, edge networks, CDN providers, or other frontend infrastructures. The purpose of this feature is simply to generate alternative client configuration links that expose configurable frontend endpoints while preserving the original domain-based routing configuration. ### Alternatives you've considered _No response_ ### Concrete use case _No response_ ### Mockups, screenshots, or examples _No response_ ### Which parts of the panel would this affect? _No response_ ### Are you willing to help? - [x] I'd like to implement this feature myself and open a PR. - [ ] I can help test once a PR is open. ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this feature has not been requested. - [x] This feature request is written in English.
bsakaguchi 2026-10-31 20:33:33 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Jun 9, 2026):

Thanks for the detailed write-up! The core of what you're describing is already implemented through the External Proxy feature on each inbound.

How to use it today

When editing or creating an inbound, go to the Transport section and look for the External Proxy toggle. Enable it, then add one entry per CDN edge IP:

Field What to put
Address (dest) CDN edge IP or hostname (e.g. cloudflare-ip-1)
Port CDN-facing port (e.g. 2053)
Remark Optional label for this endpoint
Force TLS same to inherit the inbound's TLS settings, tls to force TLS with custom SNI/fingerprint, or none
SNI Only needed if Force TLS = tls and you want a different SNI from the inbound's TLS config

With three entries configured, the panel generates three separate share links — one per entry — each with only the connection endpoint (address + port) swapped. All other parameters (Host header, SNI, path, transport settings, client ID) are preserved exactly as in the original inbound config.

This is implemented in:

  • Backend link generator: sub/subService.go (see buildExternalProxyURLLinks())
  • Frontend link generator: frontend/src/lib/xray/inbound-link.ts (see genAllLinks())
  • UI form component: frontend/src/pages/inbounds/form/transport/external-proxy.tsx
  • Schema definition: frontend/src/schemas/protocols/stream/external-proxy.ts

What is not yet covered

The existing feature requires configuring CDN endpoints per inbound. There is no global utility page or batch tool that lets you apply a list of CDN IPs across all inbounds at once, which is the part of your proposal that goes beyond what's currently available.

If you need that cross-inbound batch workflow, it would be worth keeping this issue open as a targeted enhancement request for that specific gap, rather than the full feature (which already exists). You may also want to look at #4891, which covers a related concern about per-inbound address overrides in subscription output.

<!-- gh-comment-id:4656374650 --> @github-actions[bot] commented on GitHub (Jun 9, 2026): Thanks for the detailed write-up\! The core of what you're describing is already implemented through the **External Proxy** feature on each inbound. ## How to use it today When editing or creating an inbound, go to the **Transport** section and look for the **External Proxy** toggle. Enable it, then add one entry per CDN edge IP: | Field | What to put | |---|---| | **Address (dest)** | CDN edge IP or hostname (e.g. `cloudflare-ip-1`) | | **Port** | CDN-facing port (e.g. `2053`) | | **Remark** | Optional label for this endpoint | | **Force TLS** | `same` to inherit the inbound's TLS settings, `tls` to force TLS with custom SNI/fingerprint, or `none` | | **SNI** | Only needed if Force TLS = `tls` and you want a different SNI from the inbound's TLS config | With three entries configured, **the panel generates three separate share links** — one per entry — each with only the connection endpoint (address + port) swapped. All other parameters (Host header, SNI, path, transport settings, client ID) are preserved exactly as in the original inbound config. This is implemented in: - Backend link generator: `sub/subService.go` (see `buildExternalProxyURLLinks()`) - Frontend link generator: `frontend/src/lib/xray/inbound-link.ts` (see `genAllLinks()`) - UI form component: `frontend/src/pages/inbounds/form/transport/external-proxy.tsx` - Schema definition: `frontend/src/schemas/protocols/stream/external-proxy.ts` ## What is not yet covered The existing feature requires configuring CDN endpoints **per inbound**. There is no global utility page or batch tool that lets you apply a list of CDN IPs across all inbounds at once, which is the part of your proposal that goes beyond what's currently available. If you need that cross-inbound batch workflow, it would be worth keeping this issue open as a targeted enhancement request for that specific gap, rather than the full feature (which already exists). You may also want to look at #4891, which covers a related concern about per-inbound address overrides in subscription output.
Author
Owner

@MHSanaei commented on GitHub (Jul 3, 2026):

Since this was filed, the panel gained a dedicated Hosts page (sidebar → Hosts, PR #5409) that covers this workflow: for an inbound, add one Host entry per CDN edge IP with security "same", and the panel generates one config per Host for every client — Host header, SNI, path, transport, and client IDs are preserved; only the endpoint changes. Entries can be reordered, disabled, remarked, and excluded per subscription format, and it's all manageable via /panel/api/hosts for automation.

Closing as implemented; if a bulk "paste an IP list" input on that page would still help, feel free to open a focused follow-up request.

<!-- gh-comment-id:4873841631 --> @MHSanaei commented on GitHub (Jul 3, 2026): Since this was filed, the panel gained a dedicated **Hosts** page (sidebar → Hosts, PR #5409) that covers this workflow: for an inbound, add one Host entry per CDN edge IP with security "same", and the panel generates one config per Host for every client — Host header, SNI, path, transport, and client IDs are preserved; only the endpoint changes. Entries can be reordered, disabled, remarked, and excluded per subscription format, and it's all manageable via `/panel/api/hosts` for automation. Closing as implemented; if a bulk "paste an IP list" input on that page would still help, feel free to open a focused follow-up request.
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#3590
No description provided.