fix crash for tun
This commit is contained in:
@ -61,6 +61,7 @@ func (h *tunnelHandler) parseMetadata(md mdata.Metadata) (err error) {
|
|||||||
xingress.RulesOption(rules),
|
xingress.RulesOption(rules),
|
||||||
xingress.LoggerOption(logger.Default().WithFields(map[string]any{
|
xingress.LoggerOption(logger.Default().WithFields(map[string]any{
|
||||||
"kind": "ingress",
|
"kind": "ingress",
|
||||||
|
"ingress": "@internal",
|
||||||
})),
|
})),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/go-gost/core/logger"
|
||||||
mdata "github.com/go-gost/core/metadata"
|
mdata "github.com/go-gost/core/metadata"
|
||||||
mdutil "github.com/go-gost/core/metadata/util"
|
mdutil "github.com/go-gost/core/metadata/util"
|
||||||
"github.com/go-gost/core/router"
|
"github.com/go-gost/core/router"
|
||||||
@ -99,7 +100,13 @@ func (l *tunListener) parseMetadata(md mdata.Metadata) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if config.Router == nil && len(l.routes) > 0 {
|
if config.Router == nil && len(l.routes) > 0 {
|
||||||
config.Router = xrouter.NewRouter(xrouter.RoutesOption(l.routes))
|
config.Router = xrouter.NewRouter(
|
||||||
|
xrouter.RoutesOption(l.routes),
|
||||||
|
xrouter.LoggerOption(logger.Default().WithFields(map[string]any{
|
||||||
|
"kind": "router",
|
||||||
|
"router": "@internal",
|
||||||
|
})),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
l.md.config = config
|
l.md.config = config
|
||||||
|
Reference in New Issue
Block a user