1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-10-30 07:48:08 -04:00
v2fly/proxy/socks/config.go
2017-04-28 14:58:58 +02:00

26 lines
515 B
Go

package socks
import "v2ray.com/core/common/protocol"
func (v *Account) Equals(another protocol.Account) bool {
if account, ok := another.(*Account); ok {
return v.Username == account.Username
}
return false
}
func (v *Account) AsAccount() (protocol.Account, error) {
return v, nil
}
func (v *ServerConfig) HasAccount(username, password string) bool {
if v.Accounts == nil {
return false
}
storedPassed, found := v.Accounts[username]
if !found {
return false
}
return storedPassed == password
}