mitmproxy

package
v1.2.3-sp3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMITMCACert

func GetMITMCACert() ([]byte, []byte, error)

Types

type Config

type Config struct {
	Host            string        `json:"host"`
	Port            int           `json:"port"`
	Ca              []byte        `json:"ca"`
	Key             []byte        `json:"key"`
	TransparentMode bool          `json:"transparent_mode"`
	Timeout         time.Duration `json:"timeout"`
	DownstreamProxy []string      `json:"downstream_proxy"`
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(opts ...Option) (*Config, error)

type MITMProxy

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

func NewMITMProxy

func NewMITMProxy(opt ...Option) (*MITMProxy, error)

func (*MITMProxy) AddConnectionCount

func (m *MITMProxy) AddConnectionCount()

func (*MITMProxy) Run

func (m *MITMProxy) Run(ctx context.Context) error

func (*MITMProxy) SubConnectionCount

func (m *MITMProxy) SubConnectionCount()

type Option

type Option func(config *Config)

func WithAutoCa

func WithAutoCa() Option

func WithCaCert

func WithCaCert(ca []byte, key []byte) Option

func WithDefaultTimeout

func WithDefaultTimeout(d float64) Option

func WithDownstreamProxy

func WithDownstreamProxy(c ...string) Option

func WithHijackRequest

func WithHijackRequest(c func(isHttps bool, req *http.Request, raw []byte) []byte) Option

func WithHijackResponse

func WithHijackResponse(c func(isHttps bool, req *http.Request, rspRaw []byte, remoteAddr string) []byte) Option

func WithHost

func WithHost(host string) Option

func WithMirrorRequest

func WithMirrorRequest(cb func(req *http.Request)) Option

func WithMirrorResponse

func WithMirrorResponse(cb func(isHttps bool, req *http.Request, rsp *http.Response, remoteAddr string)) Option

func WithPort

func WithPort(port int) Option

func WithTransparentMode

func WithTransparentMode(b bool) Option

func WithWebHook

func WithWebHook(cb func(req *http.Request) []byte) Option

Directories

Path Synopsis
Package mitm provides tooling for MITMing TLS connections.
Package mitm provides tooling for MITMing TLS connections.

Jump to

Keyboard shortcuts

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