fix(sub): use configured spiderX instead of always randomizing

applyShareRealityParams and SubJsonService.realityData generated a fresh
random spx on every export, so share links, "export all links", and JSON
subscriptions never matched a spiderX configured on the inbound and two
exports of the same client disagreed with each other. Read the value from
realitySettings.settings like pbk/fp/pqv and keep the random value only as
a fallback when none is configured.

Closes #5718
This commit is contained in:
MHSanaei
2026-07-01 23:07:05 +02:00
parent 49773c18de
commit 1f2e3e1447
4 changed files with 89 additions and 21 deletions
+5
View File
@@ -1357,6 +1357,11 @@ func applyShareRealityParams(stream map[string]any, params map[string]string) {
}
}
params["spx"] = "/" + random.Seq(15)
if spxValue, ok := searchKey(realitySettings, "spiderX"); ok {
if spx, ok := spxValue.(string); ok && len(spx) > 0 {
params["spx"] = spx
}
}
}
}