From f390b9cf2fe290bfe230df4045616ee83534eeb2 Mon Sep 17 00:00:00 2001 From: wwqgtxx Date: Mon, 5 Dec 2022 23:10:47 +0800 Subject: [PATCH] fix: inbound nil pointer --- listener/inbound/mixed.go | 2 +- listener/inbound/redir.go | 2 +- listener/inbound/tproxy.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/listener/inbound/mixed.go b/listener/inbound/mixed.go index 651ab486..a2920c69 100644 --- a/listener/inbound/mixed.go +++ b/listener/inbound/mixed.go @@ -57,7 +57,7 @@ func (m *Mixed) Listen(tcpIn chan<- C.ConnContext, udpIn chan<- C.PacketAdapter) return err } if m.udp { - m.lUDP, err = socks.NewUDP(m.Address(), udpIn, m.Additions()...) + m.lUDP, err = socks.NewUDP(m.RawAddress(), udpIn, m.Additions()...) if err != nil { return err } diff --git a/listener/inbound/redir.go b/listener/inbound/redir.go index 37b5aab9..7a1685ba 100644 --- a/listener/inbound/redir.go +++ b/listener/inbound/redir.go @@ -44,7 +44,7 @@ func (r *Redir) Address() string { // Listen implements constant.InboundListener func (r *Redir) Listen(tcpIn chan<- C.ConnContext, udpIn chan<- C.PacketAdapter) error { var err error - r.l, err = redir.New(r.Address(), tcpIn, r.Additions()...) + r.l, err = redir.New(r.RawAddress(), tcpIn, r.Additions()...) if err != nil { return err } diff --git a/listener/inbound/tproxy.go b/listener/inbound/tproxy.go index 223ebd93..7aa8af8d 100644 --- a/listener/inbound/tproxy.go +++ b/listener/inbound/tproxy.go @@ -57,7 +57,7 @@ func (t *TProxy) Listen(tcpIn chan<- C.ConnContext, udpIn chan<- C.PacketAdapter } if t.udp { if t.lUDP != nil { - t.lUDP, err = tproxy.NewUDP(t.Address(), udpIn, t.Additions()...) + t.lUDP, err = tproxy.NewUDP(t.RawAddress(), udpIn, t.Additions()...) if err != nil { return err }