[GH-ISSUE #6625] [Feature]: Per-inbound and per-balancer manual JSON routing rules in JSON subscription #4429

Open
opened 2026-10-31 20:39:37 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @NooNooJoo on GitHub (Sep 23, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6625

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?

  • 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 @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? - [ ] 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.
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#4429
No description provided.