Skip to content

Commit

Permalink
Fix socks5 handshake
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Sep 25, 2023
1 parent 494f88c commit 5b05b5c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions protocol/socks/handshake.go
Expand Up @@ -171,6 +171,9 @@ func HandleConnection0(ctx context.Context, conn net.Conn, version byte, authent
if err != nil {
return err
}
if response.Status != socks5.UsernamePasswordStatusSuccess {
return E.New("socks5: authentication failed, username=", usernamePasswordAuthRequest.Username, ", password=", usernamePasswordAuthRequest.Password)
}
}
request, err := socks5.ReadRequest(conn)
if err != nil {
Expand Down

0 comments on commit 5b05b5c

Please sign in to comment.