Add native Shadowsocks 2022 support with gRPC hot‑add and config safeguards #1964
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
xray.proxy.shadowsocks_2022.Accounttype and payload; remove the non-existent...Usertype.VITE_BASE_API=/api/).Why
proxy is not a UserManagerandfailed to parse user > proto: not found./api/prefix causing 404 on/admin/token; we need reproducible builds.What was done
API/types
ShadowsocksMethods; classic account now rejects 2022 methods.Shadowsocks2022Accountthat sendsTypedMessage(type="xray.proxy.shadowsocks_2022.Account")with a minimal wire-encodedkeyfield, matching Xray-core expectations.Backend models & config
ShadowsocksSettingsauto-generates/validates per-user PSK lengths per method (16/32 bytes).method+server_psk; ensuresclientslist has a bootstrap entry to enable UserManager; validates missing/invalid PSK with clear errors.password = "{server_psk}:{user_psk}"and expose SS2022 methods.Operations
Dashboard
VITE_BASE_API=/api/.How it works (SS2022 path)
method=2022-blake3-...,password=<server_psk>,clientscontains a bootstrap user to activateUserManager.common.protocol.UserwhereaccountisTypedMessage(type="xray.proxy.shadowsocks_2022.Account", value=<key bytes>); gRPCAlterInbound(AddUserOperation)succeeds without core restart.${server_psk}:${user_psk}, method matches inbound./api/core/configreturns 400 with a clear message; service won’t start with an impossible mapping.Migration / Notes
VITE_BASE_API=/api/(see build workflow).{server_psk}:{user_psk}.Known issue: Shadowsocks‑2022 memory leak in Xray-core
Testing
DOCKER_BUILDKIT=0 docker compose build marzban.docker compose up -d marzban.POST /api/admin/token→ 200.POST /api/userwith SS2022 method+user key on inboundShadowsocks 2022 TCP→ 200; links generated; no gRPC errors; Xray stays up.