Documentation
¶
Overview ¶
Package proxy implements an intercepting HTTP/HTTPS forward proxy that captures every flow. Plain HTTP is forwarded directly; HTTPS is intercepted via CONNECT + a locally-minted leaf certificate (TLS MITM).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Events ¶
type Events interface {
FlowCaptured(*store.Flow) // a new flow (request seen / sent upstream)
FlowUpdated(*store.Flow) // an existing flow filled in (response, error, …)
}
Events is an optional sink notified when a flow is captured (used by the control plane to push live updates to the UI).
type ScopeChecker ¶
ScopeChecker reports whether a flow is in the engagement's target scope. When set, only in-scope requests are held by the intercept gate.
type Server ¶
type Server struct {
Scope ScopeChecker // nil → everything in scope
// SelfPorts are this tool's own loopback ports (control plane + proxy). Set
// by cmd; traffic to them is forwarded but never recorded, so proxying
// localhost doesn't fill history with — or feedback-loop on — our own UI.
SelfPorts []int
// contains filtered or unexported fields
}
Server is the intercepting forward-proxy HTTP handler.
func New ¶
func New(st *store.Store, cap *capture.Capturer, ca *tlsca.CA, eng *intercept.Engine, events Events) *Server
New builds a proxy Server. ca, eng, and events may each be nil.
func (*Server) ServeHTTP ¶
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP dispatches: CONNECT → TLS MITM; absolute-URI → HTTP forward proxy.
func (*Server) SetCaptureScopeOnly ¶ added in v0.5.0
SetCaptureScopeOnly switches between persisting all traffic (false) and only in-scope traffic (true) — a space optimization for long engagements. With no scope rules defined everything is in scope, so this becomes a no-op until the operator sets a target scope.
func (*Server) SetSuppressBrowserTelemetry ¶ added in v0.7.0
SetSuppressBrowserTelemetry controls whether known Chrome and Firefox background telemetry, update, and crash-reporting hosts are silently forwarded without being captured or held by the intercept gate. Enabled by default; users may turn it off to inspect browser background traffic.
func (*Server) SetUpstreamProxy ¶
SetUpstreamProxy routes outbound traffic through a chained proxy (e.g. a corporate proxy). An empty string means connect directly.