fix: correct C.Metadata

This commit is contained in:
wwqgtxx
2022-12-04 22:08:20 +08:00
parent 62226e8b3d
commit 62474e0ed6
23 changed files with 161 additions and 161 deletions

View File

@ -10,11 +10,11 @@ import (
)
type Base struct {
config *BaseOption
name string
preferRulesName string
listenAddr netip.Addr
port int
config *BaseOption
name string
specialRules string
listenAddr netip.Addr
port int
}
func NewBase(options *BaseOption) (*Base, error) {
@ -26,11 +26,11 @@ func NewBase(options *BaseOption) (*Base, error) {
return nil, err
}
return &Base{
name: options.Name(),
listenAddr: addr,
preferRulesName: options.PreferRulesName,
port: options.Port,
config: options,
name: options.Name(),
listenAddr: addr,
specialRules: options.PreferRulesName,
port: options.Port,
config: options,
}, nil
}

View File

@ -44,7 +44,7 @@ func (h *HTTP) Address() string {
// Listen implements constant.InboundListener
func (h *HTTP) Listen(tcpIn chan<- C.ConnContext, udpIn chan<- C.PacketAdapter) error {
var err error
h.l, err = http.NewWithInfos(h.RawAddress(), h.name, h.preferRulesName, tcpIn)
h.l, err = http.NewWithInfos(h.RawAddress(), h.name, h.specialRules, tcpIn)
if err != nil {
return err
}

View File

@ -52,12 +52,12 @@ func (m *Mixed) Address() string {
// Listen implements constant.InboundListener
func (m *Mixed) Listen(tcpIn chan<- C.ConnContext, udpIn chan<- C.PacketAdapter) error {
var err error
m.l, err = mixed.NewWithInfos(m.RawAddress(), m.name, m.preferRulesName, tcpIn)
m.l, err = mixed.NewWithInfos(m.RawAddress(), m.name, m.specialRules, tcpIn)
if err != nil {
return err
}
if m.udp {
m.lUDP, err = socks.NewUDPWithInfos(m.Address(), m.name, m.preferRulesName, udpIn)
m.lUDP, err = socks.NewUDPWithInfos(m.Address(), m.name, m.specialRules, udpIn)
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.NewWithInfos(r.Address(), r.name, r.preferRulesName, tcpIn)
r.l, err = redir.NewWithInfos(r.Address(), r.name, r.specialRules, tcpIn)
if err != nil {
return err
}

View File

@ -70,11 +70,11 @@ func (s *Socks) Address() string {
// Listen implements constant.InboundListener
func (s *Socks) Listen(tcpIn chan<- C.ConnContext, udpIn chan<- C.PacketAdapter) error {
var err error
if s.stl, err = socks.NewWithInfos(s.RawAddress(), s.name, s.preferRulesName, tcpIn); err != nil {
if s.stl, err = socks.NewWithInfos(s.RawAddress(), s.name, s.specialRules, tcpIn); err != nil {
return err
}
if s.udp {
if s.sul, err = socks.NewUDPWithInfos(s.RawAddress(), s.name, s.preferRulesName, udpIn); err != nil {
if s.sul, err = socks.NewUDPWithInfos(s.RawAddress(), s.name, s.specialRules, udpIn); err != nil {
return err
}
}

View File

@ -51,13 +51,13 @@ func (t *TProxy) Address() string {
// Listen implements constant.InboundListener
func (t *TProxy) Listen(tcpIn chan<- C.ConnContext, udpIn chan<- C.PacketAdapter) error {
var err error
t.lTCP, err = tproxy.NewWithInfos(t.RawAddress(), t.name, t.preferRulesName, tcpIn)
t.lTCP, err = tproxy.NewWithInfos(t.RawAddress(), t.name, t.specialRules, tcpIn)
if err != nil {
return err
}
if t.udp {
if t.lUDP != nil {
t.lUDP, err = tproxy.NewUDPWithInfos(t.Address(), t.name, t.preferRulesName, udpIn)
t.lUDP, err = tproxy.NewUDPWithInfos(t.Address(), t.name, t.specialRules, udpIn)
if err != nil {
return err
}