proxy

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package proxy provides HTTP/HTTPS proxy functionality using goproxy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Port to listen on
	Port int
	// Verbose enables verbose logging
	Verbose bool
	// EnableMITM enables HTTPS interception
	EnableMITM bool
	// CA is the certificate authority for MITM (required if EnableMITM is true)
	CA *ca.CA
	// Capturer is the traffic capturer (optional)
	Capturer *capture.Capturer
	// SkipHosts is a list of hosts to skip MITM for (e.g., hosts with cert pinning)
	SkipHosts []string
	// Upstream is the upstream proxy URL (e.g., http://proxy:8080)
	Upstream string
}

Config holds proxy configuration options.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns default proxy configuration.

type Proxy

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

Proxy represents an HTTP/HTTPS proxy server.

func New

func New(cfg *Config) (*Proxy, error)

New creates a new proxy with the given configuration.

func (*Proxy) ListenAndServe

func (p *Proxy) ListenAndServe(addr string) error

ListenAndServe starts the proxy server.

func (*Proxy) Server

func (p *Proxy) Server() *goproxy.ProxyHttpServer

Server returns the underlying goproxy server.

Jump to

Keyboard shortcuts

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