1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-20 00:07:06 -05:00
v2fly/proxy/socks/server_config.go

30 lines
486 B
Go
Raw Normal View History

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
)
const (
AuthTypeNoAuth = byte(0)
AuthTypePassword = byte(1)
)
type Config struct {
AuthType byte
Accounts map[string]string
Address v2net.Address
UDPEnabled bool
2016-08-25 15:55:49 -04:00
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
2015-12-03 16:41:06 -05:00
}