mirror of
https://github.com/wyx2685/V2bX.git
synced 2025-01-22 18:08:14 -05:00
fix bug: func RouterFromContext return nil router
This commit is contained in:
parent
af9fb2084a
commit
00ec5b2d4d
@ -1,7 +1,6 @@
|
|||||||
package sing
|
package sing
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -215,8 +214,9 @@ func (b *Box) AddNode(tag string, info *panel.NodeInfo, config *conf.Options) er
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
in, err := inbound.New(
|
in, err := inbound.New(
|
||||||
context.Background(),
|
b.ctx,
|
||||||
b.router,
|
b.router,
|
||||||
b.logFactory.NewLogger(F.ToString("inbound/", c.Type, "[", tag, "]")),
|
b.logFactory.NewLogger(F.ToString("inbound/", c.Type, "[", tag, "]")),
|
||||||
c,
|
c,
|
||||||
|
@ -31,6 +31,7 @@ type DNSConfig struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Box struct {
|
type Box struct {
|
||||||
|
ctx context.Context
|
||||||
createdAt time.Time
|
createdAt time.Time
|
||||||
router adapter.Router
|
router adapter.Router
|
||||||
inbounds map[string]adapter.Inbound
|
inbounds map[string]adapter.Inbound
|
||||||
@ -169,6 +170,7 @@ func New(c *conf.CoreConfig) (vCore.Core, error) {
|
|||||||
}
|
}
|
||||||
router.SetClashServer(server)
|
router.SetClashServer(server)
|
||||||
return &Box{
|
return &Box{
|
||||||
|
ctx: ctx,
|
||||||
router: router,
|
router: router,
|
||||||
inbounds: inMap,
|
inbounds: inMap,
|
||||||
outbounds: outbounds,
|
outbounds: outbounds,
|
||||||
|
Loading…
Reference in New Issue
Block a user