[GH-ISSUE #6756] [Feature]: Add Support for JSON subscription based Encrypted HAPP Link #4503

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

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

Hi,

It would be really great to have support for HAPP Encrypted Subscription links based on JSON subscriptions in 3x-ui.

As you may know, the method introduced by Patterniha is not fully supported through a standard share link, so a custom JSON subscription is required to properly define all the necessary values.

I run a small, non-commercial server used only by a few friends and relatives. With the recent internet blackouts, everyone has apparently become an expert in this field! 😄
Their modifications have caused many domains to be blacklisted so I have decided to use Encrypted Subs, Although I know it is possible to decipher, but it is enough to stop them from playing around.

I would like to use HAPP Encrypted Subscriptions, but currently it seems that only v2ray://-based share links are supported, while JSON-based subscription links are not.

Using the standard sub links does not appear to be an option either, since some of the required fields are not currently available.

Therefore, having the ability to generate encrypted HAPP subscription links directly from a JSON subscription would be extremely useful.

Thank you for considering this feature!

Describe the solution you'd like

Provide encrypted HAPP subscription links from a JSON subscription

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 @farid220 on GitHub (Oct 6, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6756 ### Is your feature request related to a problem? Hi, It would be really great to have support for **HAPP Encrypted Subscription links based on JSON subscriptions** in 3x-ui. As you may know, the method introduced by **Patterniha** is not fully supported through a standard share link, so a custom JSON subscription is required to properly define all the necessary values. I run a small, non-commercial server used only by a few friends and relatives. With the recent internet blackouts, everyone has apparently become an expert in this field! 😄 Their modifications have caused many domains to be blacklisted so I have decided to use Encrypted Subs, Although I know it is possible to decipher, but it is enough to stop them from playing around. I would like to use **HAPP Encrypted Subscriptions**, but currently it seems that only `v2ray://`-based share links are supported, while JSON-based subscription links are not. Using the standard sub links does not appear to be an option either, since some of the required fields are not currently available. Therefore, having the ability to generate **encrypted HAPP subscription links directly from a JSON subscription** would be extremely useful. Thank you for considering this feature! ### Describe the solution you'd like Provide encrypted HAPP subscription links from a JSON subscription ### 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. - [x] 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 6, 2026):

This is a valid feature request: the panel's built-in Happ encrypted link (happ://crypt5/...) only ever wraps the standard subscription URL. It cannot currently wrap the JSON subscription URL.

How it works today

The Encrypted subscription links setting (happLinkEnable, off by default) adds a Happ variant to the client QR code window. The link is built in HappService.currentSource (internal/web/service/happ.go:115-120), which reads only subURI and appends the client's subscription ID:

subEnable, enabled := values["subEnable"].(bool)
subURI, hasURI := values["subURI"].(string)
if !enabled || !subEnable || !hasURI || subURI == "" || client.SubID == "" {
	return "", client, "source_unavailable"
}
return subURI + client.SubID, client, ""

The endpoint POST /panel/api/clients/happLink/:id (internal/web/controller/client.go:60) takes no parameter for picking a format. subJsonURI / subJsonPath are never used there. So when Happ decrypts the link, it fetches the raw subscription path (gLink.GET(":subid", a.subs), internal/sub/controller.go:334) and not the JSON one (gJson.GET(":subid", a.subJsons), line 340). This has been the behaviour since the feature was introduced in 6a5b4fab "feat(happ): generate Crypt5 subscription links locally (#6494)" (request #6381).

What the request needs

To support this, the generator would have to accept a choice between the standard and the JSON subscription. For the JSON option it would use the subJsonURI value already computed in GetDefaultSettings (internal/web/service/setting.go:1985-1986), and it should only be offered when subJsonEnable is on. The QR modal would also need a way to choose between the two. The 8192-byte source limit (ErrHappSourceTooLong) would not be a problem, because only the URL is encrypted, not the JSON body.

Until then, a manual workaround: enable the JSON subscription, copy the client's JSON subscription URL, and encrypt it with Happ's own crypt link tool outside the panel. I haven't verified that tool against this panel's output, so please test it with one client first.

Related: #6381 (the original request for Crypt5 generation, which covered only the standard subscription URL). I found no existing request for the JSON variant.

Verdict: Feature request

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

<!-- gh-comment-id:6023402837 --> @github-actions[bot] commented on GitHub (Oct 6, 2026): This is a valid feature request: the panel's built-in Happ encrypted link (`happ://crypt5/...`) only ever wraps the **standard** subscription URL. It cannot currently wrap the JSON subscription URL. **How it works today** The **Encrypted subscription links** setting (`happLinkEnable`, off by default) adds a Happ variant to the client QR code window. The link is built in `HappService.currentSource` (`internal/web/service/happ.go:115-120`), which reads only `subURI` and appends the client's subscription ID: ```go subEnable, enabled := values["subEnable"].(bool) subURI, hasURI := values["subURI"].(string) if !enabled || !subEnable || !hasURI || subURI == "" || client.SubID == "" { return "", client, "source_unavailable" } return subURI + client.SubID, client, "" ``` The endpoint `POST /panel/api/clients/happLink/:id` (`internal/web/controller/client.go:60`) takes no parameter for picking a format. `subJsonURI` / `subJsonPath` are never used there. So when Happ decrypts the link, it fetches the raw subscription path (`gLink.GET(":subid", a.subs)`, `internal/sub/controller.go:334`) and not the JSON one (`gJson.GET(":subid", a.subJsons)`, line 340). This has been the behaviour since the feature was introduced in 6a5b4fab "feat(happ): generate Crypt5 subscription links locally (#6494)" (request #6381). **What the request needs** To support this, the generator would have to accept a choice between the standard and the JSON subscription. For the JSON option it would use the `subJsonURI` value already computed in `GetDefaultSettings` (`internal/web/service/setting.go:1985-1986`), and it should only be offered when `subJsonEnable` is on. The QR modal would also need a way to choose between the two. The 8192-byte source limit (`ErrHappSourceTooLong`) would not be a problem, because only the URL is encrypted, not the JSON body. Until then, a manual workaround: enable the JSON subscription, copy the client's JSON subscription URL, and encrypt it with Happ's own crypt link tool outside the panel. I haven't verified that tool against this panel's output, so please test it with one client first. Related: #6381 (the original request for Crypt5 generation, which covered only the standard subscription URL). I found no existing request for the JSON variant. 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#4503
No description provided.