Skip to content

Commit

Permalink
Email in shadowsocks
Browse files Browse the repository at this point in the history
  • Loading branch information
DarienRaymond committed Feb 28, 2016
1 parent c1c22a5 commit 3d4da58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions proxy/shadowsocks/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ type Config struct {
Key []byte
UDP bool
Level protocol.UserLevel
Email string
}

func PasswordToCipherKey(password string, keySize int) []byte {
Expand Down
2 changes: 2 additions & 0 deletions proxy/shadowsocks/config_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 3d4da58

Please sign in to comment.