mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #4941] [Feature]: How to customize Clash subscription proxy groups in 3x-ui / Issue with "Happ only" routing rule #3461
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#3461
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 @yifeng623 on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4941
I am trying to configure the Clash subscription feature in 3x-ui, specifically regarding how to use and customize the proxy groups (Proxy Providers).
Although I have enabled the routing features, the configuration notes indicate that it is "Happ only" (restricted to Happ). I would like to know how to further modify or extend this setup so it can work with other clients or customized routing rules.
Could anyone guide me on how to properly modify the template or configuration to achieve this? Thanks!
Describe the solution you'd like
"Hey guys, quick question about 3x-ui's Clash subscription feature. I see the routing is enabled but it says 'Happ only'. How can I modify the proxy groups and routing rules so they aren't restricted to just Happ? Any tips on where to edit the config template?"
Alternatives you've considered
No response
Concrete use case
No response
Mockups, screenshots, or examples
No response
Which parts of the panel would this affect?
No response
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Jun 5, 2026):
There are two separate routing systems in the panel's subscription settings, and the "Happ only" note only applies to one of them.
The "Happ only" section (not what you want for Clash)
In Panel Settings → Subscription → Happ, there are two fields:
subEnableRouting) — emits aRouting-Enable: trueHTTP response headersubRoutingRules) — emits aRouting: ...HTTP response header (placeholder showshapp://routing/add/...)These are HTTP headers only. They are sent on every subscription response (base64 links, JSON, and Clash alike) but only the Happ client actually reads and acts on them. That's why they're labelled "Happ only" — other clients ignore those headers entirely. The comment in the source (
web/entity/entity.go:66) confirms:// Subscription global routing rules (Only for Happ).The Clash/Mihomo routing section (what you want)
Right below the Happ section in Panel Settings → Subscription → Clash / Mihomo, there are two different fields:
subClashEnableRouting) — toggle this onsubClashRules) — paste your YAML rules hereWhen a Clash subscription is fetched, the backend (
sub/subClashService.go) callsmergeClashRulesYAMLto inject those rules into the generated YAML before serving it. The UI placeholder shows the expected format:You can also pass a YAML block with a
rules:key. If your rules include aMATCH,...line, it replaces the defaultMATCH,PROXYcatch-all; otherwise your rules are prepended before it.Example to bypass Iranian sites directly:
Proxy-groups customization
The generated Clash config currently hardcodes a single
select-type group namedPROXY(sub/subClashService.go:77-83). ThesubClashRulesfield only merges into therules:list — there is no UI field for customproxy-groups:. If you need load-balancing, fallback, or url-test groups, that would require a new feature (a custom proxy-groups template field similar tosubClashRules). Feel free to keep this issue open as a feature request for that, or submit a PR.@yifeng623 commented on GitHub (Jun 5, 2026):
Thanks for the detailed breakdown! However, looking at my panel (as shown in the screenshot ), there is actually no Clash/Mihomo section available at all. The UI cuts off right after the Happ section.
@KaPyStTa commented on GitHub (Jun 5, 2026):
Hi! Go to the XRay configuration, then to the routing and configure what you need there. It is very useful if you have a cascading connection.
@LORD07Sson commented on GitHub (Jun 5, 2026):
Update your X-UI version
@flippo2kk commented on GitHub (Jun 5, 2026):
geox-url and rule-providers are sorely missing
@heyzeyu commented on GitHub (Jul 9, 2026):
I am hitting the same limitation with native Clash/Mihomo subscriptions.
My setup:
Desired Clash/Mihomo behavior:
Current workaround:
This works, but 3x-ui is no longer the single source of truth, and every client/device needs extra configuration outside the panel.
Suggested MVP:
proxy-groups,rule-providers, andrulesbefore/after the default generated rules.Related issues: #5824 for routing injection and #5124 for subscription packages. This issue seems specifically about Clash/Mihomo proxy-groups/rules, so I think custom subscription templates/profiles would cover this use case well.
@MHSanaei commented on GitHub (Jul 23, 2026):
There are two separate routing systems in the subscription settings, and "Happ only" applies to the wrong one for your goal.
The "Happ only" fields (Settings → Subscription → Happ): Enable Routing and Routing Rules only emit
Routing-Enable/RoutingHTTP response headers that only the Happ client reads — every other client ignores them. Not what you want for Clash.The Clash fields (Settings → Subscription → Clash / Mihomo) are what you want: Clash Enable Routing and Clash Routing Rules. On a Clash fetch these are merged into the generated YAML. You can paste bare rule lines or a full YAML block — a
rules:list containing aMATCH,...line replaces the defaultMATCH,PROXYcatch-all; otherwise your rules are prepended before it.Proxy groups: the base config ships one
PROXYgroup (typeselect) auto-filled with all your proxies +DIRECT. Because the merge copies any other top-level key from your YAML block straight onto the config, you can override proxy groups by including aproxy-groups:key in the Clash Routing Rules block — it replaces the default group wholesale, e.g.:One limitation: when you override
proxy-groupsyourself, the panel does not auto-populate your custom groups with the generated per-node proxy names (only the built-in defaultPROXYgroup gets that), so a customurl-testreferencing every node isn't fully automatic today — that auto-fill would be a valid small enhancement. For rules and basic group customization the fields above cover it, so closing as answered.