egress

package
v2.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

Proxy is an egress proxy server.

func NewProxy

func NewProxy(logger *slog.Logger, addr string, opts ...ProxyOption) *Proxy

NewProxy creates a new egress proxy. By default, only loopback destinations are allowed.

func NewProxyWithAllowedDestinations

func NewProxyWithAllowedDestinations(logger *slog.Logger, addr string, entries []string) *Proxy

NewProxyWithAllowedDestinations creates a proxy with an explicit destination allowlist.

func (*Proxy) Start

func (p *Proxy) Start() error

Start starts the proxy server.

func (*Proxy) Stop

func (p *Proxy) Stop(ctx context.Context) error

Stop stops the proxy server.

type ProxyOption

type ProxyOption func(*Proxy)

func WithAllowedDestinations

func WithAllowedDestinations(entries []string) ProxyOption

WithAllowedDestinations adds explicit host, host:port, IP, or CIDR destinations. Loopback destinations are allowed by default.

Jump to

Keyboard shortcuts

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