Socks4a server: Check if the client sends an IP address as domain (#3628)

Fixes https://github.com/XTLS/Xray-core/issues/3622
This commit is contained in:
风扇滑翔翼 2024-08-03 10:08:23 +08:00 committed by GitHub
parent 7e24239c9a
commit 644901d1a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -74,7 +74,7 @@ func (s *ServerSession) handshake4(cmd byte, reader io.Reader, writer io.Writer)
if err != nil {
return nil, errors.New("failed to read domain for socks 4a").Base(err)
}
address = net.DomainAddress(domain)
address = net.ParseAddress(domain)
}
switch cmd {