socks5: fixed a bug in target getting

This commit is contained in:
nadoo committed 2021-03-19 15:57:16 +08:00
1 parent 88f09b30bc
commit 93728c6378
5 files changed
+22 -23

No files matched your search

+1 -2
View File
@@ -159,8 +159,7 @@ func (s *Socks5) ListenAndServeUDP() {
// Handshake fast-tracks SOCKS initialization to get target address to connect.
func (s *Socks5) handshake(c net.Conn) (socks.Addr, error) {
// Read RFC 1928 for request and reply structure and sizes
buf := pool.GetBuffer(socks.MaxAddrLen)
defer pool.PutBuffer(buf)
buf := make([]byte, socks.MaxAddrLen)
// read VER, NMETHODS, METHODS
if _, err := io.ReadFull(c, buf[:2]); err != nil {