proxy

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProxyTransport

func ProxyTransport(skipVerify bool, upstreamProxy string) (*http.Transport, error)

Types

type BodyRewrite added in v1.8.0

type BodyRewrite struct {
	Pattern     *regexp.Regexp
	Replacement []byte
}

type Handler

type Handler struct {
	Transport        *http.Transport
	Store            *capture.Store
	Mocks            *mock.Store
	Intercept        *intercept.Queue
	InterceptMatch   string
	InterceptTimeout time.Duration
	HostCerts        *cert.HostCertCache
	Log              *slog.Logger
	MitmEnable       bool
	HostRewrites     []HostRewrite
	AddHeaders       []HeaderValue
	RemoveHeaders    []string
	OnCapture        func(*capture.Capture)
	IgnorePatterns   []string
	MapRemotes       []MapRemoteRule
	BodyRewrites     []BodyRewrite
	MaxBodySize      int64
	Mode             string
	ReverseTarget    *url.URL
}

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type HeaderValue added in v1.3.0

type HeaderValue struct {
	Key   string
	Value string
}

type HostRewrite added in v1.3.0

type HostRewrite struct {
	From string
	To   string
}

type MapRemoteRule added in v1.8.0

type MapRemoteRule struct {
	SourceHost string
	TargetBase *url.URL
}

type Server

type Server struct {
	*http.Server
	Listener net.Listener
}

func NewServer

func NewServer(addr string, handler http.Handler, log *slog.Logger) (*Server, error)

func (*Server) Shutdown

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

func (*Server) Start

func (s *Server) Start()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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