1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-15 05:35:48 -05:00

socks client config

This commit is contained in:
v2ray
2016-07-25 23:45:25 +02:00
parent a509252c24
commit 6a620d1c6d
6 changed files with 75 additions and 6 deletions

View File

@@ -1,29 +0,0 @@
package socks
import (
v2net "github.com/v2ray/v2ray-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 int
}
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
}