v2ray-core/proxy/socks/config.go

29 lines
480 B
Go
Raw Normal View History

2015-12-06 18:21:15 +01:00
package socks
2015-12-03 22:41:06 +01:00
import (
v2net "github.com/v2ray/v2ray-core/common/net"
2015-12-03 22:41:06 +01:00
)
const (
AuthTypeNoAuth = byte(0)
AuthTypePassword = byte(1)
)
type Config struct {
AuthType byte
Accounts map[string]string
Address v2net.Address
UDPEnabled bool
}
func (this *Config) HasAccount(username, password string) bool {
if this.Accounts == nil {
return false
}
storedPassed, found := this.Accounts[username]
if !found {
return false
}
return storedPassed == password
2015-12-03 22:41:06 +01:00
}