Quellcode durchsuchen

Email in shadowsocks

v2ray vor 9 Jahren
Ursprung
Commit
3d4da5822b
2 geänderte Dateien mit 3 neuen und 0 gelöschten Zeilen
  1. 1 0
      proxy/shadowsocks/config.go
  2. 2 0
      proxy/shadowsocks/config_json.go

+ 1 - 0
proxy/shadowsocks/config.go

@@ -62,6 +62,7 @@ type Config struct {
 	Key    []byte
 	UDP    bool
 	Level  protocol.UserLevel
+	Email  string
 }
 
 func PasswordToCipherKey(password string, keySize int) []byte {

+ 2 - 0
proxy/shadowsocks/config_json.go

@@ -18,6 +18,7 @@ func (this *Config) UnmarshalJSON(data []byte) error {
 		Password serial.StringLiteral `json:"password"`
 		UDP      bool                 `json:"udp"`
 		Level    byte                 `json:"level"`
+		Email    string               `json:"email"`
 	}
 	jsonConfig := new(JsonConfig)
 	if err := json.Unmarshal(data, jsonConfig); err != nil {
@@ -55,6 +56,7 @@ func (this *Config) UnmarshalJSON(data []byte) error {
 	this.Key = PasswordToCipherKey(jsonConfig.Password.String(), this.Cipher.KeySize())
 
 	this.Level = protocol.UserLevel(jsonConfig.Level)
+	this.Email = jsonConfig.Email
 
 	return nil
 }