fix(shadowsocks): keep a 2022 inbound with no enabled client locked

When every client of a Shadowsocks-2022 inbound was disabled the panel
handed the core an empty client list, from which xray-core builds a
single-user server keyed by the inbound's server key alone. That key is
the first half of every link the panel ever issued, so a client cut off
for quota, expiry or by the operator connected again with it.

An inbound left without clients now gets a placeholder user whose key
is random and held only in memory, in the config and in the running
core alike. The core stays multi-user, and disabling the last real
client takes the same remove-and-restart path as any other client, so
its live sessions end as well.
This commit is contained in:
MHSanaei
2026-11-01 00:30:14 +01:00
parent 07bbf4788a
commit c3a32c8343
5 changed files with 136 additions and 1 deletions
+3
View File
@@ -329,6 +329,9 @@ func (s *XrayService) GetXrayConfig() (*xray.Config, error) {
if mutated {
settings["clients"] = finalClients
}
if inbound.Protocol == model.Shadowsocks && xray.LockShadowsocks2022(settings) {
mutated = true
}
}
if inboundCanHostFallbacks(inbound) {