Fix: panic of socks5 client missing authentication
This commit is contained in:
parent
7206450be0
commit
a008bc063f
1 changed files with 4 additions and 0 deletions
|
@ -229,6 +229,10 @@ func ClientHandshake(rw io.ReadWriter, addr Addr, command Command, user *User) (
|
|||
}
|
||||
|
||||
if buf[1] == 2 {
|
||||
if user == nil {
|
||||
return nil, ErrAuth
|
||||
}
|
||||
|
||||
// password protocol version
|
||||
authMsg := &bytes.Buffer{}
|
||||
authMsg.WriteByte(1)
|
||||
|
|
Loading…
Reference in a new issue