From ecaddd897e3229174f866241ca8ce183834583d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Tue, 9 Aug 2022 14:48:08 +0800 Subject: [PATCH] Fix direct connect --- outbound/default.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/outbound/default.go b/outbound/default.go index 5149b570..6f339e6d 100644 --- a/outbound/default.go +++ b/outbound/default.go @@ -110,9 +110,9 @@ func connectPacketConnection(ctx context.Context, this N.Dialer, conn N.PacketCo var outConn net.Conn var err error if len(metadata.DestinationAddresses) > 0 { - outConn, err = N.DialSerial(ctx, this, N.NetworkTCP, metadata.Destination, metadata.DestinationAddresses) + outConn, err = N.DialSerial(ctx, this, N.NetworkUDP, metadata.Destination, metadata.DestinationAddresses) } else { - outConn, err = this.DialContext(ctx, N.NetworkTCP, metadata.Destination) + outConn, err = this.DialContext(ctx, N.NetworkUDP, metadata.Destination) } if err != nil { return N.HandshakeFailure(conn, err)