From 0c17babaf95eb1f83a7b91a1f965f1742bd87d22 Mon Sep 17 00:00:00 2001 From: Anton Zadvorny Date: Sat, 11 Jan 2025 08:18:30 +0300 Subject: [PATCH] Move connection closure outside of library to the client code in case of UDP Associate --- dialer.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/dialer.go b/dialer.go index 04fa466..6ed1594 100644 --- a/dialer.go +++ b/dialer.go @@ -4,7 +4,6 @@ import ( "context" "errors" "fmt" - "io" "net" "time" ) @@ -163,12 +162,6 @@ func (s *Dialer) handleUDP(conn net.Conn, addr *Addr) (*UDPConn, error) { return nil, err } - go func() { - io.Copy(io.Discard, conn) - conn.Close() - packetConn.Close() - }() - remoteAddr, err := AddrFromSocks(rep.ATYP, rep.BindAddr, rep.BindPort).UDP() if err != nil { return nil, err