mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #6628] [MERGED] fix(sub): make Happ require auth on its local SOCKS/HTTP proxy #6382
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#6382
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?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6628
Author: @rudenko-ks
Created: 9/23/2026
Status: ✅ Merged
Merged: 9/26/2026
Merged by: @MHSanaei
Base:
main← Head:feat/happ-local-proxy-auth📝 Commits (2)
a53e27ffix(sub): make Happ require auth on its local SOCKS/HTTP proxy6a47725Merge branch 'main' into feat/happ-local-proxy-auth📊 Changes
27 files changed (+162 additions, -0 deletions)
View changed files
📝
docs/public/openapi.json(+8 -0)📝
frontend/public/openapi.json(+8 -0)📝
frontend/src/generated/examples.ts(+2 -0)📝
frontend/src/generated/schemas.ts(+8 -0)📝
frontend/src/generated/types.ts(+2 -0)📝
frontend/src/generated/zod.ts(+2 -0)📝
frontend/src/models/setting.ts(+1 -0)📝
frontend/src/pages/settings/HappSettingsContent.tsx(+17 -0)📝
frontend/src/schemas/setting.ts(+1 -0)📝
internal/sub/happ.go(+7 -0)📝
internal/sub/happ_test.go(+34 -0)📝
internal/sub/sub.go(+1 -0)📝
internal/web/entity/entity.go(+1 -0)📝
internal/web/service/setting.go(+5 -0)📝
internal/web/translation/ar-EG.json(+5 -0)📝
internal/web/translation/en-US.json(+5 -0)📝
internal/web/translation/es-ES.json(+5 -0)📝
internal/web/translation/fa-IR.json(+5 -0)📝
internal/web/translation/id-ID.json(+5 -0)📝
internal/web/translation/ja-JP.json(+5 -0)...and 7 more files
📄 Description
Problem
Happ starts its local SOCKS5 (
127.0.0.1:10808) and HTTP inbounds without authorization by default(confirmed on Happ Android 4.4.1 and desktop 4.3.0: Settings → Inbounds → Authorization mode: Disable).
Any other app on the same device can connect to that proxy directly — bypassing Android's per-app VPN
routing — and learn the VPN server's address. This is the leak publicly described in March–April 2026 for
Happ, v2rayNG, Hiddify and other VLESS clients (Habr 1020080, xakep.ru 2026-04-07). Happ removed its exposed
Xray API (HandlerService) afterwards, but the unauthenticated local proxy remained (kod.ru, 2026-04-11).
Happ already lets a subscription fix this:
socks-auth-mode/http-auth-mode=auto | manual | from-json | disableare standard headers in Happ's app-management docs — no Provider ID required.
Change
subHappLocalProxyAuth(Settings → Subscription → Happ), valuesauto(default),disable, or empty (send nothing, keep the client's own setting).ApplyHappHeaderssends bothSocks-Auth-ModeandHttp-Auth-Modewith that value.Panels that never enabled the Happ integration see no change; non-Happ clients get nothing.
make gen.Verification
TestApplyHappHeaders_LocalProxyAuth(table): Happ+auto → both headersauto;disableforwarded;empty → none; non-Happ UA → none; auto-detect off → none. Fails without the change.
socks-auth-mode: manual+ a test user/password switched Inbounds to Manual with exactly thosecredentials on "Refresh subscription";
autoswitched it to Auto with generated credentials.Notes
autoby default: the unsafe state is the client default;autoneeds no admin input and Happ generatesper-device random credentials, so nothing leaks and nothing has to be distributed.
that is a client choice and out of scope here.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.