2015-12-06 12:21:15 -05:00
|
|
|
package socks
|
2015-12-03 16:41:06 -05:00
|
|
|
|
|
|
|
import (
|
2016-08-20 14:55:45 -04:00
|
|
|
v2net "v2ray.com/core/common/net"
|
2015-12-03 16:41:06 -05:00
|
|
|
)
|
|
|
|
|
2016-08-28 17:46:50 -04:00
|
|
|
func (this *ServerConfig) HasAccount(username, password string) bool {
|
2016-01-15 06:43:06 -05:00
|
|
|
if this.Accounts == nil {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
storedPassed, found := this.Accounts[username]
|
|
|
|
if !found {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
return storedPassed == password
|
2015-12-03 16:41:06 -05:00
|
|
|
}
|
2016-08-28 17:46:50 -04:00
|
|
|
|
|
|
|
func (this *ServerConfig) GetNetAddress() v2net.Address {
|
|
|
|
if this.Address == nil {
|
|
|
|
return v2net.LocalHostIP
|
|
|
|
}
|
|
|
|
return this.Address.AsAddress()
|
|
|
|
}
|