[GH-ISSUE #6671] [Feature]: Option to disable default PROXY group when using custom Clash URL #4456

Open
opened 2026-10-31 20:39:47 +07:00 by bsakaguchi · 1 comment
Owner

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

When importing custom Clash / Mihomo routing rules via a fixed HTTPS URL, 3x-ui still forcefully appends the default PROXY group into the subscription YAML. Users providing complete profiles via URL cannot remove it.

Describe the solution you'd like

Add a toggle switch under Settings -> Subscription -> Clash / Mihomo (e.g. "Include Default PROXY Group", default: true).

When turned off, do not inject the default PROXY group, allowing the remote HTTPS URL profile to fully control the proxy groups.

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?

Frontend (UI / panel pages), Backend (API endpoints, login, settings)

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 @HinaMai on GitHub (Sep 27, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6671 ### Is your feature request related to a problem? When importing custom Clash / Mihomo routing rules via a fixed **HTTPS URL**, 3x-ui still forcefully appends the default `PROXY` group into the subscription YAML. Users providing complete profiles via URL cannot remove it. ### Describe the solution you'd like Add a toggle switch under **Settings -> Subscription -> Clash / Mihomo** (e.g. "Include Default PROXY Group", default: `true`). When turned off, do not inject the default `PROXY` group, allowing the remote HTTPS URL profile to fully control the proxy groups. ### 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? Frontend (UI / panel pages), Backend (API endpoints, login, settings) ### 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.
Author
Owner

@github-actions[bot] commented on GitHub (Sep 27, 2026):

This is a valid feature request: the default PROXY group is kept on purpose today, and no setting turns it off. There is a workaround, though. If your remote profile defines its own group named exactly PROXY, that group replaces the built-in one instead of being added next to it.

What the code does now

The Clash/Mihomo builder always starts from a base config with one PROXY select group and a MATCH,PROXY rule (internal/sub/clash_service.go:156-164):

"proxy-groups": []map[string]any{{
    "name":    "PROXY",
    "type":    "select",
    "proxies": proxyNames,
}},
"rules": []string{"MATCH,PROXY"},

A remote HTTPS source is then merged in by mergeRemoteClashRules, which only takes proxy-groups, rule-providers and rules from it (remoteClashAllowedKey, clash_service.go:1377-1384). The groups are merged by name in mergeClashProxyGroups (clash_service.go:1487-1520). Remote groups go first, and each base group is appended afterwards unless the remote already used its name:

for _, name := range baseOrder {
    if _, replaced := seen[name]; replaced {
        continue
    }
    merged = append(merged, baseByName[name])
}

This is deliberate. TestMergeRemoteClashRulesKeepsBaseProxyGroupWhenRemoteOmitsIt (internal/sub/remote_routing_test.go:509) asserts that PROXY survives when the remote leaves it out. TestMergeRemoteClashRulesPreservesGeneratedProxies (remote_routing_test.go:441) shows a remote PROXY group taking the place of the default one.

Workaround available today

Name one of your remote groups PROXY. The panel will then drop its generated group, and the output will contain only your groups:

proxy-groups:
  - name: PROXY
    type: select
    include-all: true
rules:
  - MATCH,PROXY

include-all: true is accepted here. The pinned test above uses it, and validateRemoteClashValue only rejects a non-empty use: list (proxy-providers). If your rules include their own MATCH rule, the default MATCH,PROXY is dropped too (mergeClashRules, clash_service.go:1537-1539).

A toggle to leave out the default group completely, even when the remote does not name one PROXY, would be new behaviour. So this stays open as a feature request. If the toggle is added, a remote profile would then have to reference only its own groups, because validateClashRouteGraph (clash_service.go:1386) rejects any reference to an unknown group.

Related: #5889 (custom Clash/Mihomo profiles with proxy-groups, rule-providers and rules), #6363 (proxy-providers in the remote Clash routing source).

Verdict: Feature request

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:5860528020 --> @github-actions[bot] commented on GitHub (Sep 27, 2026): This is a valid feature request: the default `PROXY` group is kept on purpose today, and no setting turns it off. There is a workaround, though. If your remote profile defines its own group named exactly `PROXY`, that group **replaces** the built-in one instead of being added next to it. **What the code does now** The Clash/Mihomo builder always starts from a base config with one `PROXY` select group and a `MATCH,PROXY` rule (`internal/sub/clash_service.go:156-164`): ```go "proxy-groups": []map[string]any{{ "name": "PROXY", "type": "select", "proxies": proxyNames, }}, "rules": []string{"MATCH,PROXY"}, ``` A remote HTTPS source is then merged in by `mergeRemoteClashRules`, which only takes `proxy-groups`, `rule-providers` and `rules` from it (`remoteClashAllowedKey`, `clash_service.go:1377-1384`). The groups are merged by name in `mergeClashProxyGroups` (`clash_service.go:1487-1520`). Remote groups go first, and each base group is appended afterwards unless the remote already used its name: ```go for _, name := range baseOrder { if _, replaced := seen[name]; replaced { continue } merged = append(merged, baseByName[name]) } ``` This is deliberate. `TestMergeRemoteClashRulesKeepsBaseProxyGroupWhenRemoteOmitsIt` (`internal/sub/remote_routing_test.go:509`) asserts that `PROXY` survives when the remote leaves it out. `TestMergeRemoteClashRulesPreservesGeneratedProxies` (`remote_routing_test.go:441`) shows a remote `PROXY` group taking the place of the default one. **Workaround available today** Name one of your remote groups `PROXY`. The panel will then drop its generated group, and the output will contain only your groups: ```yaml proxy-groups: - name: PROXY type: select include-all: true rules: - MATCH,PROXY ``` `include-all: true` is accepted here. The pinned test above uses it, and `validateRemoteClashValue` only rejects a non-empty `use:` list (proxy-providers). If your rules include their own `MATCH` rule, the default `MATCH,PROXY` is dropped too (`mergeClashRules`, `clash_service.go:1537-1539`). A toggle to leave out the default group completely, even when the remote does not name one `PROXY`, would be new behaviour. So this stays open as a feature request. If the toggle is added, a remote profile would then have to reference only its own groups, because `validateClashRouteGraph` (`clash_service.go:1386`) rejects any reference to an unknown group. Related: #5889 (custom Clash/Mihomo profiles with proxy-groups, rule-providers and rules), #6363 (proxy-providers in the remote Clash routing source). Verdict: Feature request *This reply was generated automatically; a maintainer may follow up.* <!-- claude-issue:analyst -->
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#4456
No description provided.