修复SINGBOX内核REALITY

This commit is contained in:
wyx2685
2023-11-18 10:37:08 +09:00
parent cf8016f405
commit 5d18876b12
4 changed files with 11 additions and 19 deletions

View File

@@ -232,7 +232,7 @@ func (b *Sing) AddNode(tag string, info *panel.NodeInfo, config *conf.Options) e
in, err := inbound.New(
b.ctx,
b.router,
b.box.Router(),
b.logFactory.NewLogger(F.ToString("inbound/", c.Type, "[", tag, "]")),
c,
nil,

View File

@@ -23,10 +23,10 @@ type DNSConfig struct {
}
type Sing struct {
box *box.BoxEx
box *box.Box
ctx context.Context
hookServer *HookServer
router adapter.RouterEx
router adapter.Router
logFactory log.Factory
inbounds map[string]adapter.Inbound
}
@@ -79,7 +79,7 @@ func New(c *conf.CoreConfig) (vCore.Core, error) {
os.Setenv("SING_DNS_PATH", c.SingConfig.DnsConfigPath)
}
ctx := context.Background()
b, err := box.NewEx(box.Options{
b, err := box.New(box.Options{
Context: ctx,
Options: options,
})
@@ -87,13 +87,12 @@ func New(c *conf.CoreConfig) (vCore.Core, error) {
return nil, err
}
hs := NewHookServer(c.SingConfig.EnableConnClear)
b.RouterEx().SetClashServer(hs)
b.LogFactory()
b.Router().SetClashServer(hs)
return &Sing{
ctx: ctx,
ctx: b.Router().GetCtx(),
box: b,
hookServer: hs,
router: b.RouterEx(),
router: b.Router(),
logFactory: b.LogFactory(),
inbounds: make(map[string]adapter.Inbound),
}, nil