Documentation
¶
Index ¶
- type Proxy
- func (p *Proxy) Addr() string
- func (p *Proxy) CACertPath() string
- func (p *Proxy) GetThrottleBPS() int64
- func (p *Proxy) GetThrottleLatency() time.Duration
- func (p *Proxy) Init(addr string) error
- func (p *Proxy) Serve(ctx context.Context) error
- func (p *Proxy) SetThrottle(bps int64, latency time.Duration)
- func (p *Proxy) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Proxy ¶
type Proxy struct {
SslInsecure bool
HostFilter *hostfilter.HostFilter
ScriptEngine *scripting.Engine
ThrottleBPS int64 // bytes/sec (0 = unlimited)
ThrottleLatency time.Duration // per-response latency
BreakpointCtrl breakpoint.Controller
Resolver *procinfo.Resolver
DecoderRegistry *bodydecoder.Registry
// contains filtered or unexported fields
}
Proxy wraps go-mitmproxy and captures traffic into a RingBuffer.
func New ¶
func New(s *store.RingBuffer, dataDir string) *Proxy
New creates a Proxy that writes captured flows into the given store. dataDir is the base data directory (CA certs stored under dataDir/).
func (*Proxy) CACertPath ¶
CACertPath returns the path to the CA certificate file for user trust.
func (*Proxy) GetThrottleBPS ¶ added in v0.1.5
GetThrottleBPS returns current bandwidth limit.
func (*Proxy) GetThrottleLatency ¶ added in v0.1.5
GetThrottleLatency returns current latency setting.
func (*Proxy) Init ¶
Init sets up the MITM proxy (CA generation + port validation). This must be called before Serve. addr is e.g. ":8080".
func (*Proxy) SetThrottle ¶ added in v0.1.5
SetThrottle updates throttle settings at runtime.
Click to show internal directories.
Click to hide internal directories.