proxy

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package proxy implements an HTTPS intercepting proxy with TLS MITM for monitoring and controlling outbound traffic.

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, pol *policy.Engine, skipContentTypes []string) *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.

func (*Interceptor) SetResolver added in v0.1.0

func (i *Interceptor) SetResolver(r policy.PromptResolver)

SetResolver sets the prompt resolver for interactive content keyword approval.

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