add network for bypass

This commit is contained in:
ginuerzh
2023-09-30 17:51:55 +08:00
parent ea585fc25d
commit 836cf6eade
24 changed files with 92 additions and 160 deletions

View File

@ -139,7 +139,7 @@ func (p *chainHop) Select(ctx context.Context, opts ...hop.SelectOption) *chain.
// hop level bypass
if p.options.bypass != nil &&
p.options.bypass.Contains(ctx, options.Addr) {
p.options.bypass.Contains(ctx, options.Network, options.Addr, bypass.WithHostOpton(options.Host)) {
return nil
}
@ -186,7 +186,7 @@ func (p *chainHop) Select(ctx context.Context, opts ...hop.SelectOption) *chain.
}
// node level bypass
if node.Options().Bypass != nil &&
node.Options().Bypass.Contains(ctx, options.Addr) {
node.Options().Bypass.Contains(ctx, options.Network, options.Addr, bypass.WithHostOpton(options.Host)) {
continue
}