mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5316] [Feature]: Subscription LoadBalancer #3725
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#3725
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 @fmotalleb on GitHub (Jun 14, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5316
Is your feature request related to a problem?
The recent addition of subscription support for outbounds is a significant improvement.
At the same time, x-ui provides a powerful balancer feature that can distribute traffic between multiple outbounds using strategies such as load balancing or lowest-latency selection.
Currently, these two features are disconnected. While subscriptions can dynamically create and update outbounds, balancers still require users to select individual outbounds manually.
For users who rely on subscriptions, maintaining balancers will become difficult and error-prone, since the outbounds may be renamed/removed/added.
Describe the solution you'd like
The most intuitive solution would be to allow a subscription to be selected as a balancer in routing rules.
Alternatives you've considered
Another useful alternative would be allowing balancers to select outbounds using patterns.
As balancers add outbounds with a tag prefix, maybe we could add, for example,
sub1-*as a balancer member, and it would expand to all matching outbounds.This scenario is more complex, as it may match against multiple subscriptions/outbounds, and notifying the balancer of changes based on matching prefixes may require a pub/sub scenario that may be harder to implement correctly.
Concrete use case
No response
Mockups, screenshots, or examples
No response
Which parts of the panel would this affect?
Xray config generation
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Jun 14, 2026):
The prefix/wildcard selector alternative you described already works today — no code changes required. The gap is UX: the panel does not surface this workflow, so it is easy to miss.
How it works now
Each outbound subscription has a configurable
TagPrefix(set in the subscription form). When left blank it defaults tosub{id}-(e.g.,sub1-,sub2-). All outbounds fetched from that subscription receive tags prefixed with that string and those tags are stable across refreshes (seeinternal/web/service/outbound_subscription.go, lines 503–540).The balancer
selectorfield is rendered as an Ant Designmode="tags"select (frontend/src/pages/xray/balancers/BalancerFormModal.tsx, line 164), which means you can type any arbitrary string — not only the suggested tags from the dropdown. Whatever you type is written verbatim into the Xray configbalancers[].selectorarray.Xray-core interprets each selector element as a prefix: any outbound whose tag starts with that string is included in the balancer pool. The codebase comment at
outbound_subscription.golines 524–527 describes this explicitly:Practical steps (no update needed)
TagPrefix. Example: set it tomyprovider-.myprovider-and press Enter to add it as a tag.If you use the default prefix (e.g.,
sub1-) make sure no other outbounds share that prefix unintentionally.What is still missing (the real feature gap)
The UX does not guide users to this pattern:
TagPrefixfor each subscription.A first-class UI improvement — adding subscription prefixes as suggested options in the balancer selector dropdown, or a dedicated "Source subscription" selector — would make this workflow discoverable and reduce manual configuration errors. The backend already supports it; only frontend changes in
frontend/src/pages/xray/balancers/BalancerFormModal.tsxand the data passed down fromfrontend/src/pages/xray/XrayPage.tsxwould be needed (the subscriptionTagPrefixvalues are already available via the settings API response).This reply was generated automatically; a maintainer may follow up.