fix: inbound nil pointer

This commit is contained in:
wwqgtxx 2022-12-05 23:10:47 +08:00
parent 1c65a2c1b4
commit f390b9cf2f
3 changed files with 3 additions and 3 deletions

View file

@ -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
}

View file

@ -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
}

View file

@ -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
}