From 6ca14c814efb3c38ad8f15179511854bc7ffbf6e Mon Sep 17 00:00:00 2001 From: Skyxim Date: Mon, 27 Mar 2023 22:18:54 +0800 Subject: [PATCH] fix: tproxy listener cannot listen udp --- listener/inbound/tproxy.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/listener/inbound/tproxy.go b/listener/inbound/tproxy.go index fa458d2c..00cd0849 100644 --- a/listener/inbound/tproxy.go +++ b/listener/inbound/tproxy.go @@ -56,13 +56,10 @@ func (t *TProxy) Listen(tcpIn chan<- C.ConnContext, udpIn chan<- C.PacketAdapter return err } if t.udp { - if t.lUDP != nil { - t.lUDP, err = tproxy.NewUDP(t.RawAddress(), udpIn, natTable, t.Additions()...) - if err != nil { - return err - } + t.lUDP, err = tproxy.NewUDP(t.RawAddress(), udpIn, natTable, t.Additions()...) + if err != nil { + return err } - } log.Infoln("TProxy[%s] proxy listening at: %s", t.Name(), t.Address()) return nil