proxy

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DomainFilter

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

DomainFilter handles domain allowlisting.

func NewDomainFilter

func NewDomainFilter() *DomainFilter

NewDomainFilter creates a new domain filter.

func (*DomainFilter) AddAllowed

func (f *DomainFilter) AddAllowed(domain string)

AddAllowed adds a domain to the allow list. Supports wildcards like *.github.com

func (*DomainFilter) AllowAll

func (f *DomainFilter) AllowAll()

AllowAll allows all domains (disables filtering).

func (*DomainFilter) IsAllowed

func (f *DomainFilter) IsAllowed(host string) bool

IsAllowed checks if a domain is allowed.

type HTTPProxy

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

HTTPProxy is a filtering HTTP/HTTPS proxy server.

func NewHTTPProxy

func NewHTTPProxy(filter *DomainFilter) (*HTTPProxy, error)

NewHTTPProxy creates a new HTTP proxy server with domain filtering.

func NewHTTPProxyWithListener

func NewHTTPProxyWithListener(listener net.Listener, filter *DomainFilter) *HTTPProxy

NewHTTPProxyWithListener creates an HTTP proxy using an existing listener. If listener is nil, call StartUnix to create a Unix socket listener.

func (*HTTPProxy) Addr

func (p *HTTPProxy) Addr() string

Addr returns the proxy's address (host:port).

func (*HTTPProxy) Port

func (p *HTTPProxy) Port() int

Port returns just the port number.

func (*HTTPProxy) Start

func (p *HTTPProxy) Start() error

Start begins accepting connections.

func (*HTTPProxy) StartUnix

func (p *HTTPProxy) StartUnix(socketPath string) error

StartUnix starts the proxy on a Unix socket.

func (*HTTPProxy) Stop

func (p *HTTPProxy) Stop() error

Stop gracefully shuts down the proxy.

type Manager

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

Manager coordinates HTTP and SOCKS5 proxy servers for sandboxed execution.

func NewManager

func NewManager(cfg ManagerConfig) (*Manager, error)

NewManager creates and starts all necessary proxy servers. Returns nil if no proxies are needed.

func (*Manager) EnvVars

func (m *Manager) EnvVars() []string

EnvVars returns environment variables for configuring proxy in subprocesses.

func (*Manager) Port

func (m *Manager) Port() int

Port returns the HTTP proxy port.

func (*Manager) SOCKS5Port

func (m *Manager) SOCKS5Port() int

SOCKS5Port returns the SOCKS5 proxy port.

func (*Manager) SocketPath

func (m *Manager) SocketPath() string

SocketPath returns the Unix socket path (Linux only).

func (*Manager) Stop

func (m *Manager) Stop()

Stop shuts down all proxy servers.

type ManagerConfig

type ManagerConfig struct {
	AllowedHosts []string
	Verbose      bool
}

ManagerConfig holds configuration for the proxy manager.

type SOCKS5Proxy

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

SOCKS5Proxy is a filtering SOCKS5 proxy server

func NewSOCKS5Proxy

func NewSOCKS5Proxy(filter *DomainFilter) (*SOCKS5Proxy, error)

NewSOCKS5Proxy creates a new SOCKS5 proxy server with domain filtering

func (*SOCKS5Proxy) Addr

func (p *SOCKS5Proxy) Addr() string

Addr returns the proxy's address (host:port)

func (*SOCKS5Proxy) Port

func (p *SOCKS5Proxy) Port() int

Port returns just the port number

func (*SOCKS5Proxy) Start

func (p *SOCKS5Proxy) Start() error

Start begins accepting connections

func (*SOCKS5Proxy) Stop

func (p *SOCKS5Proxy) Stop() error

Stop gracefully shuts down the proxy

Jump to

Keyboard shortcuts

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