Documentation
¶
Index ¶
- func ProxyTransport(skipVerify bool, upstreamProxy string) (*http.Transport, error)
- func ServeSocks5(addr, proxyAddr, auth string, allowNets []*net.IPNet, log *slog.Logger) error
- type BodyRewrite
- type Handler
- type HeaderValue
- type HookEngine
- type HookShortCircuit
- type HostRewrite
- type MapRemoteRule
- type ProtoDecoder
- type ScopeStore
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProxyTransport ¶
Types ¶
type BodyRewrite ¶
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
Scope *ScopeStore
MapRemotes []MapRemoteRule
BodyRewrites []BodyRewrite
MaxBodySize int64
Mode string
ReverseTarget *url.URL
Delay time.Duration
ChaosRate float64
Shadows []*url.URL
Plugins []string
ProtoDecoder *ProtoDecoder
Hooks *HookEngine
Auth string
AllowNets []*net.IPNet
}
type HeaderValue ¶
type HookEngine ¶ added in v2.2.0
type HookEngine struct {
// contains filtered or unexported fields
}
HookEngine runs JS hook files per request/response/capture. All methods are no-ops on a nil receiver.
func NewHookEngine ¶ added in v2.2.0
func NewHookEngine(files []string, log *slog.Logger) *HookEngine
func (*HookEngine) RunOnCapture ¶ added in v2.2.0
func (h *HookEngine) RunOnCapture(c *capture.Capture)
func (*HookEngine) RunOnRequest ¶ added in v2.2.0
func (h *HookEngine) RunOnRequest(req *http.Request, body []byte) (*HookShortCircuit, []byte)
func (*HookEngine) RunOnResponse ¶ added in v2.2.0
type HookShortCircuit ¶ added in v2.2.0
HookShortCircuit is returned when onRequest returns a response object, meaning the origin should not be contacted.
type HostRewrite ¶
type MapRemoteRule ¶
type ProtoDecoder ¶ added in v2.1.0
type ProtoDecoder struct {
// contains filtered or unexported fields
}
ProtoDecoder holds parsed proto file descriptors for runtime gRPC decoding.
func NewProtoDecoder ¶ added in v2.1.0
func NewProtoDecoder(protoFiles []string) (*ProtoDecoder, error)
NewProtoDecoder parses the given .proto files and indexes every RPC method by its gRPC path (/package.Service/Method) for later message decoding.
func (*ProtoDecoder) DecodeRequest ¶ added in v2.1.0
func (d *ProtoDecoder) DecodeRequest(serviceMethod string, data []byte) (json.RawMessage, error)
func (*ProtoDecoder) DecodeResponse ¶ added in v2.1.0
func (d *ProtoDecoder) DecodeResponse(serviceMethod string, data []byte) (json.RawMessage, error)
type ScopeStore ¶ added in v2.5.0
type ScopeStore struct {
// contains filtered or unexported fields
}
func NewScopeStore ¶ added in v2.5.0
func NewScopeStore(patterns []string) *ScopeStore
func (*ScopeStore) Add ¶ added in v2.5.0
func (s *ScopeStore) Add(p string)
func (*ScopeStore) Get ¶ added in v2.5.0
func (s *ScopeStore) Get() []string
func (*ScopeStore) Remove ¶ added in v2.5.0
func (s *ScopeStore) Remove(p string)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.