From 670710a084fa595a9e3a54575f6f8db0739025a2 Mon Sep 17 00:00:00 2001 From: Sudo Space Date: Fri, 6 Feb 2026 21:11:34 +0330 Subject: [PATCH] Uses inbound `spx` value if available. The update allows the use of a inbound `spx` value from the reality settings for Vless and Trojan links, if one is provided. This provides more flexibility and customization options. Previously, a random `spx` value was always generated. which could override the inbound settings. --- sub/subService.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sub/subService.go b/sub/subService.go index e046ebb4..11ecb93a 100644 --- a/sub/subService.go +++ b/sub/subService.go @@ -469,7 +469,11 @@ func (s *SubService) genVlessLink(inbound *model.Inbound, email string) string { params["pqv"] = pqv } } - params["spx"] = "/" + random.Seq(15) + if spxValue, ok := searchKey(realitySettings, "spx"); ok { + if spx, ok := spxValue.(string); ok && len(spx) > 0 { + params["spx"] = spx + } + } } if streamNetwork == "tcp" && len(clients[clientIndex].Flow) > 0 { @@ -666,7 +670,11 @@ func (s *SubService) genTrojanLink(inbound *model.Inbound, email string) string params["pqv"] = pqv } } - params["spx"] = "/" + random.Seq(15) + if spxValue, ok := searchKey(realitySettings, "spx"); ok { + if spx, ok := spxValue.(string); ok && len(spx) > 0 { + params["spx"] = spx + } + } } if streamNetwork == "tcp" && len(clients[clientIndex].Flow) > 0 {