Skip to content

Commit

Permalink
Merge pull request wyx2685#20 from wyx2685/master
Browse files Browse the repository at this point in the history
fix bug: func RouterFromContext return nil router
  • Loading branch information
Yuzuki616 authored Sep 29, 2023
2 parents db238f7 + 00ec5b2 commit 1b591e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/sing/node.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package sing

import (
"context"
"crypto/rand"
"encoding/base64"
"fmt"
Expand Down Expand Up @@ -215,8 +214,9 @@ func (b *Box) AddNode(tag string, info *panel.NodeInfo, config *conf.Options) er
if err != nil {
return err
}

in, err := inbound.New(
context.Background(),
b.ctx,
b.router,
b.logFactory.NewLogger(F.ToString("inbound/", c.Type, "[", tag, "]")),
c,
Expand Down
2 changes: 2 additions & 0 deletions core/sing/sing.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type DNSConfig struct {
}

type Box struct {
ctx context.Context
createdAt time.Time
router adapter.Router
inbounds map[string]adapter.Inbound
Expand Down Expand Up @@ -169,6 +170,7 @@ func New(c *conf.CoreConfig) (vCore.Core, error) {
}
router.SetClashServer(server)
return &Box{
ctx: ctx,
router: router,
inbounds: inMap,
outbounds: outbounds,
Expand Down

0 comments on commit 1b591e2

Please sign in to comment.