fix(sub): omit non-standard fm param from Hysteria2 URI (#6048)

Hysteria2 subscription links included a v2rayN-specific fm=<json>
finalmask dump alongside standard obfs/obfs-password. Clients such as
mihomo reject the unknown query param and fail to update the provider.

Emit only the standard salamander fields in genHysteriaLink, matching
the Clash generator.

Fixes #5982
This commit is contained in:
H-TTTTT
2026-07-21 21:51:06 +08:00
committed by GitHub
parent a0dec000b2
commit fde66ba820
2 changed files with 32 additions and 4 deletions
+3 -4
View File
@@ -1025,11 +1025,10 @@ func (s *SubService) genHysteriaLink(inbound *model.Inbound, email string) strin
}
}
// salamander obfs (Hysteria2). The panel-side link generator already
// emits these; keep the subscription output in sync so a client has
// the obfs password to match the server.
// salamander obfs (Hysteria2). Emit only the standard URI fields;
// the non-standard fm=<json> finalmask dump breaks mihomo and other
// Hysteria2 clients that reject unknown query params.
if finalmask, ok := stream["finalmask"].(map[string]any); ok {
applyFinalMaskParams(finalmask, params)
if udpMasks, ok := finalmask["udp"].([]any); ok {
for _, m := range udpMasks {
mask, _ := m.(map[string]any)