From c7fd071f2223634d351d0ed3b0520af162457db1 Mon Sep 17 00:00:00 2001 From: eric Date: Sat, 6 Jul 2019 14:32:30 +0800 Subject: [PATCH] fix UDP associate Read() simply returns if the buffer is empty. --- tcp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcp.go b/tcp.go index fe0701d5..243b2704 100644 --- a/tcp.go +++ b/tcp.go @@ -48,7 +48,7 @@ func tcpLocal(addr, server string, shadow func(net.Conn) net.Conn, getAddr func( // UDP: keep the connection until disconnect then free the UDP socket if err == socks.InfoUDPAssociate { - buf := []byte{} + buf := make([]byte, 1) // block here for { _, err := c.Read(buf)