bypass

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 1 Imported by: 2 modules, 16 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package bypass defines the Bypass interface for deciding whether a target address should skip the proxy chain and connect directly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bypass

type Bypass interface {
	// IsWhitelist reports whether this rule operates as a whitelist (true)
	// or blacklist (false). In whitelist mode, only matched addresses bypass
	// the proxy; in blacklist mode, matched addresses go through the proxy.
	IsWhitelist() bool
	// Contains reports whether the given address matches this bypass rule.
	Contains(ctx context.Context, network, addr string, opts ...Option) bool
}

Bypass is an address filter that determines whether a target address should bypass the proxy chain and be reached directly. When Contains returns true for an address, that address will not go through the proxy forwarding chain.

type Option

type Option func(opts *Options)

Option is a functional option for configuring Options.

func WithHostOption added in v0.6.1

func WithHostOption(host string) Option

WithHostOption sets the HTTP Host header.

func WithPathOption

func WithPathOption(path string) Option

WithPathOption sets the HTTP request path.

func WithService added in v0.6.1

func WithService(service string) Option

WithService sets the service name.

type Options

type Options struct {
	// Service is the service name this bypass rule belongs to.
	Service string
	// Host is the HTTP Host header value.
	Host string
	// Path is the HTTP request path.
	Path string
}

Options holds the initialization parameters for a Bypass rule.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL