Help us shape the future of Go! Take the 2026 Go Developer Survey

httpproxy

package
v0.1.61 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

Package httpproxy is the http_proxy trace kind: a recording HTTP proxy the processes a capture observes are pointed at through the environment it exports, storing each exchange it relays as an http.Exchange.

Index

Constants

View Source
const Kind = "http_proxy"

Kind is the name the http_proxy kind registers under.

Variables

This section is empty.

Functions

func NewKind

NewKind is the http_proxy trace kind: exchanges masked, capped at 6MiB a value, and their bodies stored as structure when they hold JSON.

Types

type Mode

type Mode string

Mode is how much of the traffic through the proxy a capture sees.

const (
	// ModeConnect records each CONNECT tunnel by its host, duration and byte
	// counts, its payload left encrypted.
	ModeConnect Mode = "connect"
	// ModeMITM terminates TLS with an ephemeral CA the capture exports for its
	// processes to trust, recording each decrypted exchange in full.
	ModeMITM Mode = "mitm"
)

type Params

type Params struct {
	Mode Mode `json:"mode,omitempty" clicky:"title=Mode"`
	// Hosts are host globs (path.Match), without a port, limiting what is
	// recorded and, under mitm, what is decrypted; empty records every host.
	Hosts []string `json:"hosts,omitempty" clicky:"title=Hosts"`
	// Paths are URL-path globs (path.Match) limiting which exchanges are
	// recorded; empty records every path. A tunnel has no path to match, so
	// it is recorded on Hosts alone.
	Paths []string `json:"paths,omitempty" clicky:"title=Paths"`
	// Bodies caps how much of each body is kept, as a size such as 64KiB or
	// 4MiB, at most 4MiB; 0 keeps none.
	Bodies string `json:"bodies,omitempty" clicky:"title=Bodies"`
	// Redact names headers to blank on top of the built-in credential headers,
	// which are always blanked.
	Redact []string `json:"redact,omitempty" clicky:"title=Redact headers"`
	// NoProxy are host:port addresses the processes reach directly, such as a
	// server the host started, beside the proxy itself.
	NoProxy []string `json:"noProxy,omitempty" clicky:"title=No proxy"`
	// UpstreamCA is a PEM file of authorities the proxy trusts beside the
	// system roots when, under mitm, it connects to the real server, such as a
	// local test server's own certificate. It is read when the capture starts.
	UpstreamCA string `json:"upstreamCA,omitempty" clicky:"title=Upstream CA file"`
}

Params configure the recording proxy a capture's processes are pointed at. Plain (non-TLS) exchanges are recorded in full in either mode.

func (Params) Validate

func (p Params) Validate() error

Jump to

Keyboard shortcuts

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