feat(shadowsocks): implement support for SIP022 AEAD-2022 ciphers
This commit is contained in:
@@ -12,11 +12,19 @@ func buildShadowsocks(data proxy.Proxy, uuid string) string {
|
||||
if !ok {
|
||||
return ""
|
||||
}
|
||||
|
||||
password := uuid
|
||||
// SIP022 AEAD-2022 Ciphers
|
||||
if strings.Contains(ss.Method, "2022") {
|
||||
serverKey, userKey := proxy.GenerateShadowsocks2022Password(ss, uuid)
|
||||
password = fmt.Sprintf("%s:%s", serverKey, userKey)
|
||||
}
|
||||
|
||||
addr := fmt.Sprintf("%s=ss, %s, %d", data.Name, data.Server, data.Port)
|
||||
config := []string{
|
||||
addr,
|
||||
fmt.Sprintf("encrypt-method=%s", ss.Method),
|
||||
fmt.Sprintf("password=%s", uuid),
|
||||
fmt.Sprintf("password=%s", password),
|
||||
"tfo=true",
|
||||
"udp-relay=true",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user