mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6625] [Feature]: Per-inbound and per-balancer manual JSON routing rules in JSON subscription #4429
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#4429
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 @NooNooJoo on GitHub (Sep 23, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6625
Is your feature request related to a problem?
Currently, the routing.rules block embedded into the JSON subscription is generated from a single shared template and applied identically to every inbound and every balancer profile exported in the subscription. There is no way to specify a different set of routing rules for different connections.
For example, given two separate inbounds (different protocols/outbounds, e.g. one VLESS/Reality and one Hysteria2), the JSON subscription currently outputs the exact same routing.rules array for both — only the outbound underneath differs, but the rule set, domain lists, and DNS behavior are identical for every connection. The same applies to balancer profiles exported into the subscription: all balancers currently share one global routing template, with no way to give a specific balancer its own rule set.
This makes it impossible to serve different traffic-splitting behavior per endpoint from a single panel — e.g. one connection routing certain domains through proxy while another routes the same domains differently, or excludes/includes different geosite/geoip lists.
Describe the solution you'd like
Add the ability to manually specify a full routing.rules JSON block (and, where relevant, matching DNS settings) on a per-inbound and per-balancer basis, instead of only at the global/panel level.
When a per-inbound or per-balancer routing rules field is set, it should override the global default and be used verbatim when generating the JSON subscription for that specific inbound/balancer.
If left empty for a given inbound or balancer, fall back to the current global routing rules template (backward compatible).
This should be independent of any specific client's own routing-profile mechanism (e.g. Happ's routing-profile deep links) — this is about the raw routing object embedded directly in the generated JSON config, which every Xray-core-based client consumes the same way.
Alternatives you've considered
Using one shared global routing template tuned as a compromise for all inbounds/balancers — works only if every connection is meant to behave identically, which defeats the purpose of having multiple separate inbounds/balancers in the first place.
Manually post-processing the generated subscription output outside the panel — works but adds infrastructure complexity and breaks each time the subscription regenerates.
Concrete use case
I manage multiple inbounds and balancer profiles from a single panel, each meant to serve a different purpose (different regions/exit nodes/traffic-splitting needs). Right now, all of them receive an identical routing.rules block in their JSON subscription output, so I can't give one connection a different domain/geosite split than another without manually editing the generated config after the fact — changes which get lost the next time the subscription is regenerated.
Mockups, screenshots, or examples
No response
Which parts of the panel would this affect?
Frontend (UI / panel pages), Xray config generation, Subscription (share links / Clash / JSON)
Are you willing to help?
Before submitting