1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-10-01 08:16:00 -04:00
v2fly/proxy/socks/server_config.go
Darien Raymond bbca180dba
try protobuf
2016-08-25 21:55:49 +02:00

30 lines
486 B
Go

package socks
import (
v2net "v2ray.com/core/common/net"
)
const (
AuthTypeNoAuth = byte(0)
AuthTypePassword = byte(1)
)
type Config struct {
AuthType byte
Accounts map[string]string
Address v2net.Address
UDPEnabled bool
Timeout uint32
}
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
}