mirror of https://github.com/v2ray/v2ray-core
write back error status when authentication timeout
parent
2e46e95536
commit
74938dc428
|
@ -105,10 +105,7 @@ func (s *ServerSession) Handshake(reader io.Reader, writer io.Writer) (*protocol
|
||||||
|
|
||||||
if expectedAuth == authPassword {
|
if expectedAuth == authPassword {
|
||||||
username, password, err := readUsernamePassword(reader)
|
username, password, err := readUsernamePassword(reader)
|
||||||
if err != nil {
|
if err != nil || !s.config.HasAccount(username, password) {
|
||||||
return nil, errors.Base(err).Message("Socks|Server: Failed to read username or password.")
|
|
||||||
}
|
|
||||||
if !s.config.HasAccount(username, password) {
|
|
||||||
writeSocks5AuthenticationResponse(writer, 0xFF)
|
writeSocks5AuthenticationResponse(writer, 0xFF)
|
||||||
return nil, errors.Base(err).Message("Socks|Server: Invalid username or password.")
|
return nil, errors.Base(err).Message("Socks|Server: Invalid username or password.")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue