feat(shadowsocks): implement support for SIP022 AEAD-2022 ciphers

This commit is contained in:
Chang lue Tsen
2025-05-31 11:28:06 -04:00
parent 1a21984c27
commit 0fb0aac2fa
10 changed files with 85 additions and 28 deletions
+8 -1
View File
@@ -11,10 +11,17 @@ func buildShadowsocks(data proxy.Proxy, uuid string) string {
ss := data.Option.(proxy.Shadowsocks)
addr := fmt.Sprintf("%s:%d", data.Server, data.Port)
password := uuid
if strings.Contains(ss.Method, "2022") {
serverKey, userKey := proxy.GenerateShadowsocks2022Password(ss, uuid)
password = fmt.Sprintf("%s:%s", serverKey, userKey)
}
config := []string{
addr,
fmt.Sprintf("method=%s", ss.Method),
fmt.Sprintf("password=%s", uuid),
fmt.Sprintf("password=%s", password),
"fast-open=true",
"udp-relay=true",
fmt.Sprintf("tag=%s", data.Name),