From 3d4da5822bacd19f80129f12abb637a3babefd1a Mon Sep 17 00:00:00 2001 From: v2ray Date: Sun, 28 Feb 2016 14:50:30 +0100 Subject: [PATCH] Email in shadowsocks --- proxy/shadowsocks/config.go | 1 + proxy/shadowsocks/config_json.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/proxy/shadowsocks/config.go b/proxy/shadowsocks/config.go index db0c9b825a..9ba221ded5 100644 --- a/proxy/shadowsocks/config.go +++ b/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 { diff --git a/proxy/shadowsocks/config_json.go b/proxy/shadowsocks/config_json.go index 744615c96c..595ada8ad2 100644 --- a/proxy/shadowsocks/config_json.go +++ b/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 }