1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-29 15:26:29 -04:00
v2fly/proxy/socks/server_config.go
2016-08-28 23:46:50 +02:00

24 lines
442 B
Go

package socks
import (
v2net "v2ray.com/core/common/net"
)
func (this *ServerConfig) HasAccount(username, password string) bool {
if this.Accounts == nil {
return false
}
storedPassed, found := this.Accounts[username]
if !found {
return false
}
return storedPassed == password
}
func (this *ServerConfig) GetNetAddress() v2net.Address {
if this.Address == nil {
return v2net.LocalHostIP
}
return this.Address.AsAddress()
}