fix(sub): make Happ require auth on its local SOCKS/HTTP proxy (#6628)

Happ ships its local SOCKS5 (127.0.0.1:10808) and HTTP inbounds with
authorization disabled by default. Any app on the same device can then
connect to that proxy, bypassing Android's per-app VPN routing, and learn
the VPN server address - the leak publicly described in March-April 2026
for Happ, v2rayNG and other VLESS clients. Happ fixed its Xray API
exposure, but the unauthenticated local proxy remained.

Happ exposes a standard subscription header for this (no Provider ID
required): socks-auth-mode / http-auth-mode = auto|manual|from-json|
disable. A new subscription setting, subHappLocalProxyAuth (default
"auto"), sends both headers to Happ clients. Like every other Happ header
it is emitted only when Happ auto-detect is enabled and the User-Agent is
Happ, so panels that never opted into the Happ integration see no change.
An empty value sends nothing and keeps the client's own setting.

Verified on Happ Android 4.4.1 (Xray 26.7.28): a subscription carrying
socks-auth-mode manual + a test user/password switched the client's
Inbounds screen to Manual with those credentials on "refresh subscription",
and "auto" switched it to Auto with generated credentials.

Co-authored-by: Kirill Rudenko <rudenko@npp-energy.ru>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Sanaei <ho3ein.sanaei@gmail.com>
This commit is contained in:
Kirill Rudenko
2026-09-26 23:03:20 +03:00
committed by GitHub
parent 8979072bd9
commit 6ab718f813
27 changed files with 162 additions and 0 deletions
+5
View File
@@ -1558,6 +1558,11 @@
"subHappColorProfileDesc": "以 JSON 字串自訂 iOS 顏色主題,或填入 resetcolors 以還原預設顏色。",
"subHappPingType": "延遲測試方式",
"subHappPingTypeDesc": "Happ 測量節點延遲的方式:經由代理(GET 或 HEAD)、TCP 或 ICMP。",
"subHappLocalProxyAuth": "本機代理驗證",
"subHappLocalProxyAuthDesc": "向 Happ 傳送 socks-auth-mode / http-auth-mode。沒有驗證時,裝置上的任何應用程式都能透過 Happ 的本機 SOCKS5/HTTP 代理進入通道並得知伺服器位址。「自動」讓 Happ 產生隨機憑證;不需要 Provider ID。",
"subHappLocalProxyAuthAuto": "自動(隨機憑證)",
"subHappLocalProxyAuthDisable": "停用",
"subHappLocalProxyAuthUnset": "不傳送(用戶端預設)",
"subHappAutoConnect": "啟動時自動連線",
"subHappAutoConnectDesc": "指示 Happ 在應用程式啟動時自動連線至 VPN。",
"subHappAutoConnectType": "自動連線目標",