proxy

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 19 Imported by: 0

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)
}

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

type ScopeChecker interface {
	InScope(*store.Flow) bool
}

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
	// 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) Serve

func (s *Server) Serve(ln net.Listener) error

Serve accepts connections on ln until it is closed.

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) SetUpstreamProxy

func (s *Server) SetUpstreamProxy(raw string) error

SetUpstreamProxy routes outbound traffic through a chained proxy (e.g. a corporate proxy). An empty string means connect directly.

Jump to

Keyboard shortcuts

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