Move connection closure outside of library to the client code in case of UDP Associate

This commit is contained in:
Anton Zadvorny 2025-01-11 08:18:30 +03:00
parent 66fc78695a
commit 0c17babaf9

View File

@ -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