update socks5 conn

This commit is contained in:
ginuerzh
2021-11-16 18:58:47 +08:00
parent 83dacf67d5
commit 1a1ee384b7
4 changed files with 34 additions and 36 deletions

View File

@ -63,7 +63,7 @@ func (h *socks5Handler) handleUDP(ctx context.Context, conn net.Conn, req *gosoc
defer peer.Close()
go h.relayUDP(
socks.NewUDPConn(relay, h.md.udpBufferSize),
socks.UDPConn(relay, h.md.udpBufferSize),
peer,
)
} else {
@ -75,8 +75,8 @@ func (h *socks5Handler) handleUDP(ctx context.Context, conn net.Conn, req *gosoc
defer tun.Close()
go h.tunnelClientUDP(
socks.NewUDPConn(relay, h.md.udpBufferSize),
socks.UDPTunClientConn(tun, nil),
socks.UDPConn(relay, h.md.udpBufferSize),
socks.UDPTunClientPacketConn(tun),
)
}