fix auth for file handler

This commit is contained in:
ginuerzh
2023-12-16 14:28:58 +08:00
parent b1390dda1c
commit f847fa533e
17 changed files with 263 additions and 201 deletions

View File

@ -17,7 +17,7 @@ import (
"github.com/go-gost/x/internal/plugin"
)
func ParseHop(cfg *config.HopConfig) (hop.Hop, error) {
func ParseHop(cfg *config.HopConfig, log logger.Logger) (hop.Hop, error) {
if cfg == nil {
return nil, nil
}
@ -77,7 +77,7 @@ func ParseHop(cfg *config.HopConfig) (hop.Hop, error) {
}
}
node, err := node_parser.ParseNode(cfg.Name, v)
node, err := node_parser.ParseNode(cfg.Name, v, log)
if err != nil {
return nil, err
}
@ -97,7 +97,7 @@ func ParseHop(cfg *config.HopConfig) (hop.Hop, error) {
xhop.SelectorOption(sel),
xhop.BypassOption(bypass.BypassGroup(bypass_parser.List(cfg.Bypass, cfg.Bypasses...)...)),
xhop.ReloadPeriodOption(cfg.Reload),
xhop.LoggerOption(logger.Default().WithFields(map[string]any{
xhop.LoggerOption(log.WithFields(map[string]any{
"kind": "hop",
"hop": cfg.Name,
})),