proxy

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interceptor

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

Interceptor performs TLS interception (MITM) to capture HTTP traffic.

func NewInterceptor

func NewInterceptor(authority *ca.Authority, logBody bool, maxBody int, policy *policy.Engine) *Interceptor

NewInterceptor creates an interceptor backed by the given CA authority.

func (*Interceptor) Intercept

func (i *Interceptor) Intercept(clientConn net.Conn, upstreamConn net.Conn, host string, sess *audit.Session) error

Intercept performs TLS MITM on an established CONNECT tunnel. clientConn has already received "200 Connection Established". upstreamConn is a raw TCP connection to the target server.

type Server

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

func NewServer

func NewServer(listenAddr string, logger audit.SessionSink, interceptor *Interceptor) *Server

func (*Server) Address

func (s *Server) Address() string

Address returns the configured listen address.

func (*Server) IsRunning

func (s *Server) IsRunning() bool

IsRunning returns whether the proxy is currently listening.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(ctx context.Context) error

func (*Server) Start

func (s *Server) Start() error

Start begins listening in a background goroutine.

func (*Server) Stop

func (s *Server) Stop()

Stop shuts down the proxy server.

Jump to

Keyboard shortcuts

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