From 35db4195568e6c955607bb2a180e81b2846d0162 Mon Sep 17 00:00:00 2001 From: Shelikhoo Date: Mon, 27 Dec 2021 16:44:45 +0000 Subject: [PATCH] fix packetaddr inline init in proxy/socks --- proxy/socks/server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy/socks/server.go b/proxy/socks/server.go index 880020372..2cf0d82ef 100644 --- a/proxy/socks/server.go +++ b/proxy/socks/server.go @@ -192,7 +192,8 @@ func (s *Server) handleUDPPayload(ctx context.Context, conn internet.Connection, case packetaddr.PacketAddrType_None: break case packetaddr.PacketAddrType_Packet: - udpDispatcherConstructor = udp.NewPacketAddrDispatcherCreator(ctx).NewPacketAddrDispatcher + packetAddrDispatcherFactory := udp.NewPacketAddrDispatcherCreator(ctx) + udpDispatcherConstructor = packetAddrDispatcherFactory.NewPacketAddrDispatcher } udpServer := udpDispatcherConstructor(dispatcher, func(ctx context.Context, packet *udp_proto.Packet) { payload := packet.Payload