proxy

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StatusText

func StatusText(code int) string

StatusText returns standard status text — used by response formatting.

Types

type CA

type CA struct {
	Cert *x509.Certificate
	Key  *rsa.PrivateKey
}

func GenerateCA

func GenerateCA() (*CA, error)

type Event

type Event struct {
	ID          int64
	Method      string
	Scheme      string
	Host        string
	Path        string
	StatusCode  int
	DurationMs  int64
	Intercepted bool
}

Event describes a proxied request for display logging.

type Proxy

type Proxy struct {
	Scope     *Scope
	Store     storage.Store
	CA        *CA
	Transport http.RoundTripper // optional; defaults to http.DefaultTransport
	OnEvent   func(Event)       // optional callback for live activity display
	// contains filtered or unexported fields
}

Proxy is an HTTP/HTTPS MITM proxy.

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Scope

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

Scope determines whether a host is in scope for MITM interception.

func NewScope

func NewScope(domains, hosts []string) *Scope

func (*Scope) InScope

func (s *Scope) InScope(host string) bool

Jump to

Keyboard shortcuts

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