mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5825] [Feature]: Client-side balancer #4048
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#4048
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 @isleuntothyself on GitHub (Jul 6, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5825
Is your feature request related to a problem?
3x-ui supports load balancers but they are server-side only, so there is no way to create a "fastest location" or "auto-pick" option in a subscription (like many commercial VPN services do)
Describe the solution you'd like
i would love 3x-ui to support a client-side balancer that can be included in the subscription (JSON or other formats)
specifically:
add an option to include a balancer outbound in a subscription (with the ability to configure it as if you would do with a balancer) that the client can use locally. the client would then ping the available outbounds and automatically connect to the suitable one
Alternatives you've considered
in some panels (like Remnawave) this can be achieved by customizing the JSON subscription, but switching to other panels is not really what i want
i know that some proxy clients have the ability to sort the inbounds by ping (basically picking "the fastest one") but a lot of my users use other clients that don't have such a feature
Concrete use case
No response
Mockups, screenshots, or examples
No response
Which parts of the panel would this affect?
Subscription (share links / Clash / JSON), Xray config generation, Backend (API endpoints, login, settings), Frontend (UI / panel pages)
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Jul 6, 2026):
Thanks for the detailed request. I confirmed there is no such feature today, and traced exactly what would (and would not) need to change.
Current state (confirmed in source)
3x-ui generates three subscription formats, in
internal/sub/, none of which currently emit a client-evaluated balancer/health-check group:internal/sub/links.go): a flat base64 list ofvless://,vmess://, etc. There is no grouping concept at all here — any "pick the fastest" behavior for this format has to come from the client app itself (which matches what you already observed: some clients sort by ping, most don't).internal/sub/json_service.go, template ininternal/sub/default.json): this is a full Xray-core client config (localinbounds+outbounds+routing).GetJson(json_service.go:60) currently builds one independent config per server/client, each with a single hardcoded"proxy"outbound tag, and when there is more than one it just concatenates them into a JSON array (json_service.go:127-133) rather than merging them into one config with multiple outbounds. Xray-core itself does support arouting.balancersarray plusobservatory/burstObservatoryhealth-checking (that is literally what 3x-ui's own server-side balancer feature under Xray Settings → Balancers uses — seeObservatory/BurstObservatoryininternal/xray/config.go:23-24andfrontend/src/pages/xray/balancers/), so an Xray-core-based client could in principle honor a "fastest outbound" config the same way the server does. 3x-ui just doesn't generate that shape today.internal/sub/clash_service.go): by default only atype: selectproxy-group is generated (clash_service.go:89-97). There is a partial workaround here already: enabling Settings → Subscription → Clash/Mihomo routing (subClashEnableRouting) and putting a full YAML block in Clash/Mihomo Rules (subClashRules) lets you overrideproxy-groupswith afallback/url-testgroup viamergeClashRulesYAML(clash_service.go:712). The catch: theproxieslist must be typed out with exact, hardcoded proxy names — there's no templating, and it breaks if remark names change. This was covered in more depth in #5095.How this request differs from prior ones
This isn't a duplicate of any existing issue I could find:
Your ask is broader — a balancer definition, configurable like the existing server-side one, that gets embedded into the subscription output (JSON and/or other formats) so the client itself does the health-checking — which none of the above cover.
Given the scope (new settings, JSON-subscription config generation changes to merge multiple outbounds +
balancers/observatoryinto a single config, and UI work), this is a substantial feature rather than a small fix. I've left it labeledenhancement; a maintainer will need to weigh in on prioritization and design (e.g., whether it's JSON-only at first, given raw links and non-Xray-core clients can't honor this at all).This reply was generated automatically; a maintainer may follow up.
@DIMFLIX commented on GitHub (Jul 13, 2026):
bump
@varp commented on GitHub (Jul 22, 2026):
+1
@isleuntothyself commented on GitHub (Aug 24, 2026):
implemented in 3.7.0, thanks @DIMFLIX