socks client

This commit is contained in:
Darien Raymond
2017-01-08 01:06:35 +01:00
parent b00ee67369
commit f2e9d8a4e0
7 changed files with 583 additions and 29 deletions
+8 -1
View File
@@ -97,7 +97,14 @@ func (v *ServerSpec) AddUser(user *User) {
func (v *ServerSpec) PickUser() *User {
userCount := len(v.users)
return v.users[dice.Roll(userCount)]
switch userCount {
case 0:
return nil
case 1:
return v.users[0]
default:
return v.users[dice.Roll(userCount)]
}
}
func (v *ServerSpec) IsValid() bool {