mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #4776] [Feature]: Add a way to group multiple routing identities into one subscription #3313
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#3313
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 @chuck852 on GitHub (Jun 1, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4776
Is your feature request related to a problem?
Add a title
[Feature]: Support multi-link subscriptions with separate routing identities
Is your feature request related to a problem?
Yes.
This is not a duplicate of #4759 or #4775.
Those issues describe the visible symptom: duplicate
subIdis no longer allowed after v3.2.5. This feature request is about the missing replacement design for a previously possible advanced routing use case.Before v3.2.5, it was possible to create several different clients with the same subscription ID:
This allowed one end user to have one subscription URL:
while the subscription contained several connection options. Each option had a different Xray
user/email, so Xray routing could send each option to a differentoutboundTag.This is useful for cascade routing:
After v3.2.5, this model is no longer possible because multiple clients cannot share the same
subId.The new “attach existing client to multiple inbounds” model does not fully replace this use case. It changes the routing discriminator from
user/emailtoinboundTag. That means a separate inbound is required for each routing option.For single-port setups like VLESS TCP RAW on port 443, this is not a practical replacement. It is not possible to create several equivalent VLESS TCP RAW inbounds on the same IP and port only to separate routing paths.
The core problem is that these three concepts are now coupled too tightly:
For advanced routing, they need to be separable:
Describe the solution you'd like
I would like the panel to provide a supported way to create one subscription that contains multiple generated connection options, where each option can still have a separate routing identity.
The required behavior is:
Possible design 1: add a non-unique subscription grouping field
Introduce a new field, for example:
or:
This field would be used only to group several clients into one subscription.
Then the model could be:
Example:
The subscription endpoint could then be:
and it would include all clients with:
This keeps client identity unique while restoring multi-link subscriptions.
Possible UI placement:
On the client edit/create modal:
emailuniquesubIdbehavior if neededSubscription groupfieldOn the Clients page:
Subscription groupOn the Subscription page/API:
subscriptionGroupwhen it is setPossible design 2: add per-connection routing identity
Another option is to introduce a per-generated-link routing identity.
For example, each generated connection option inside a subscription could have:
Example:
The important part is that the generated Xray configuration must expose a stable discriminator that can be used by routing rules.
Possible design 3: advanced subscription profiles
Add an advanced mode where a subscription can contain several profiles:
This would allow one subscription to contain multiple server-side route profiles without requiring multiple inbounds on the same port.
I am not asking to simply revert all v3.2.5 changes. I am asking for an explicit replacement design for the routing scenario that was possible before v3.2.5.
Alternatives you've considered
This does not fully solve the problem because routing then has to distinguish links by
inboundTag.For my scenario, all connection options need to use the same public endpoint:
I cannot create multiple equivalent TCP RAW inbounds on the same IP and port.
This is not practical for single-port deployments. For example, VLESS TCP RAW on port 443 cannot be duplicated multiple times on the same IP and port.
subIdvaluesThis breaks the user experience because the end user no longer has one subscription URL. Instead, I would have to give them several subscription URLs:
The previous working behavior allowed one subscription URL with several connection options.
This can work as a workaround, but it moves subscription logic outside 3x-ui. It also makes management, traffic accounting, link naming, and user lifecycle less consistent.
This is not a good long-term solution because v3.2.5 contains other fixes and improvements. The goal is to support the advanced routing use case in the current model, not to stay on an older version forever.
vlessRouteThis is not a general solution. It is specific to VLESS and does not cover other protocols. It is also not exposed in 3x-ui as a normal subscription/profile management feature for this use case.
Concrete use case
I use 3x-ui for cascade routing.
A single end user should receive one subscription URL, but inside that subscription they should have several connection options. Each option goes through the same public inbound endpoint but should be routed to a different outbound chain.
Example:
Server-side routing:
Cascade scheme:
This was possible before v3.2.5 by using multiple clients with the same subscription ID and different
email/uservalues.After v3.2.5, this is no longer possible because
subIdmust be unique.Using multiple inbounds is not a valid replacement here because all routes need to share the same public inbound endpoint on port 443.
This is why I believe the panel needs a separate subscription grouping mechanism or another stable per-link routing identity.
Mockups, screenshots, or examples
Possible client fields:
The subscription endpoint:
would generate links for all clients with:
Example UI idea:
Example routing rule:
Another routing rule:
This preserves the advanced routing behavior while keeping subscription management inside 3x-ui.
Which parts of the panel would this affect?
Subscription (share links / Clash / JSON)
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Jun 1, 2026):
Thank you for this detailed and well-structured feature request. You are correct that this is distinct from #4759 and #4775 — those are symptom reports about the enforcement of unique
subId, while this proposes an explicit replacement design for the advanced routing use case.Summary of the core problem:
Before v3.2.5, sharing a
subIdacross multiple clients with differentemailvalues allowed one subscription URL to carry multiple connection profiles, each routable to a differentoutboundTag. After v3.2.5 enforcedsubIduniqueness, this pattern no longer works and no direct equivalent exists.On the three proposed designs:
Design 1 (non-unique
subscriptionGroupfield) appears to be the most practical path. It decouples subscription grouping from client identity while requiring relatively contained changes: a new optional field on the client model, a new subscription endpoint (or extension of the existing one) that aggregates bysubscriptionGroup, and UI additions to the client create/edit modal. Theemail/routing identity remains unique and unchanged.Design 2 (per-connection routing identity) adds more complexity to the data model but could be useful for other scenarios beyond cascade routing.
Design 3 (advanced subscription profiles) is the most flexible but also the most invasive to implement.
Areas of the codebase that would be affected by Design 1:
subscriptionGroupfield)subscriptionGroup)subscriptionGroup)If you or anyone else wants to open a PR for Design 1, it would be helpful to ensure backward compatibility: clients without a
subscriptionGroupshould continue to behave exactly as they do today with their individualsubId.We'll leave this open for discussion and a potential contribution.