[GH-ISSUE #6938] [Feature]: specific routes for users, instead of global (Happ) #4588

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

Originally created by @RainNHard on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6938

It would be great to be able to give a specific user a different route list instead of the global route for happ. Currently, it is only possible to transmit one list of routes to everyone as a global one.

"
Routing rules

Paste a ready happ:// deeplink or one permanent HTTPS URL returning a deeplink or JSON. The panel refreshes remote rules in the background and keeps the last valid value, so subscription requests never wait for the source. (Happ only)
"

Describe the solution you'd like

Please add a button in Panel settings, subscription (custom routing)

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?

  • 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 @RainNHard on GitHub (Oct 25, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6938 ### Is your feature request related to a problem? It would be great to be able to give a specific user a different route list instead of the global route for happ. Currently, it is only possible to transmit one list of routes to everyone as a global one. " Routing rules Paste a ready happ:// deeplink or one permanent HTTPS URL returning a deeplink or JSON. The panel refreshes remote rules in the background and keeps the last valid value, so subscription requests never wait for the source. (Happ only) " ### Describe the solution you'd like Please add a button in Panel settings, subscription (custom routing) ### 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? - [ ] 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 (Oct 25, 2026):

You're right: today the panel has a single Happ routing profile, and every subscriber gets the same one. There is no per-client or per-subscription override, so this is a genuine feature request, not a bug.

How it works now

  • The Happ routing source is one panel-wide setting, subRoutingRules (internal/web/service/setting.go:117, read by GetSubRoutingRules() at setting.go:941). It is loaded once into the subscription server (internal/sub/sub.go:217, WithSUBRoutingRules(SubRoutingRules) at sub.go:376).
  • All three subscription responses (raw, JSON and Clash) pass that same value into the headers. Raw is at internal/sub/controller.go:518, and the other two are at controller.go:860 and controller.go:928:
    a.ApplyCommonHeaders(c, header, a.updateInterval, metadata.Title, ..., a.subEnableRouting, a.subRoutingRules, a.subHideSettings)
    
    ApplyCommonHeaders then writes it out as the Routing header (controller.go:994-995). Nothing in that path looks at which client or subId is asking.
  • Placeholders won't work around this either. Per-subscription placeholders such as {...} are rendered only for the title, support URL, profile URL and announce text (internal/sub/placeholders.go:90-105). The routing source is passed through unrendered, so you can't use one HTTPS URL that returns different rules for different subIds.

What the feature would need (for the maintainer)

  1. A per-client (or per-subId) routing source stored on the client. That is a model change, so it needs a migration in internal/database/db.go.
  2. A field for it in the client editor. Settings → Subscription is global, so a button there could only pick a global profile.
  3. In ApplyCommonHeaders, fall back to the global subRoutingRules when the client has no override.
  4. The remote-refresh job (internal/web/job/remote_routing_job.go:20) only refreshes the single global source. It would also have to cache and refresh every distinct per-client URL.

I found no earlier issue asking for this. #3988 (the original Happ header integration) is related but different.

Verdict: Feature request

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

<!-- gh-comment-id:6402588089 --> @github-actions[bot] commented on GitHub (Oct 25, 2026): You're right: today the panel has a single Happ routing profile, and every subscriber gets the same one. There is no per-client or per-subscription override, so this is a genuine feature request, not a bug. **How it works now** - The Happ routing source is one panel-wide setting, `subRoutingRules` (`internal/web/service/setting.go:117`, read by `GetSubRoutingRules()` at `setting.go:941`). It is loaded once into the subscription server (`internal/sub/sub.go:217`, `WithSUBRoutingRules(SubRoutingRules)` at `sub.go:376`). - All three subscription responses (raw, JSON and Clash) pass that same value into the headers. Raw is at `internal/sub/controller.go:518`, and the other two are at `controller.go:860` and `controller.go:928`: ```go a.ApplyCommonHeaders(c, header, a.updateInterval, metadata.Title, ..., a.subEnableRouting, a.subRoutingRules, a.subHideSettings) ``` `ApplyCommonHeaders` then writes it out as the `Routing` header (`controller.go:994-995`). Nothing in that path looks at which client or subId is asking. - Placeholders won't work around this either. Per-subscription placeholders such as `{...}` are rendered only for the title, support URL, profile URL and announce text (`internal/sub/placeholders.go:90-105`). The routing source is passed through unrendered, so you can't use one HTTPS URL that returns different rules for different subIds. **What the feature would need** (for the maintainer) 1. A per-client (or per-subId) routing source stored on the client. That is a model change, so it needs a migration in `internal/database/db.go`. 2. A field for it in the client editor. Settings → Subscription is global, so a button there could only pick a global profile. 3. In `ApplyCommonHeaders`, fall back to the global `subRoutingRules` when the client has no override. 4. The remote-refresh job (`internal/web/job/remote_routing_job.go:20`) only refreshes the single global source. It would also have to cache and refresh every distinct per-client URL. I found no earlier issue asking for this. #3988 (the original Happ header integration) is related but different. 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#4588
No description provided.