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

@ -30,10 +30,10 @@ type bypassWrapper struct {
r *bypassRegistry
}
func (w *bypassWrapper) Contains(ctx context.Context, addr string) bool {
func (w *bypassWrapper) Contains(ctx context.Context, network, addr string, opts ...bypass.Option) bool {
bp := w.r.get(w.name)
if bp == nil {
return false
}
return bp.Contains(ctx, addr)
return bp.Contains(ctx, network, addr, opts...)
}