Documentation
¶
Overview ¶
Package control serves the Interceptor UI and the REST + SSE control API on the fixed localhost control port. It bridges the browser UI to the store and the intercept engine and pushes live events (captured flows, hold-queue changes) over Server-Sent Events.
Index ¶
- func LoadProxyAddrs(st *store.Store) []string
- type DeviceEndpoint
- type Hub
- func (h *Hub) FlowCaptured(f *store.Flow)
- func (h *Hub) FlowUpdated(f *store.Flow)
- func (h *Hub) GetSelfAddr() string
- func (h *Hub) Handler() http.Handler
- func (h *Hub) NotifyBypassAdded(hosts []string)
- func (h *Hub) SetControlRebinder(r Rebinder)
- func (h *Hub) SetSelfAddr(addr string)
- func (h *Hub) SetUpdate(latest string, available bool)
- func (h *Hub) WSFramed(flowID int64)
- type MultiProxyRebinder
- type Rebinder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadProxyAddrs ¶ added in v0.22.0
LoadProxyAddrs reads persisted proxy listeners for process startup.
Types ¶
type DeviceEndpoint ¶ added in v0.22.0
type DeviceEndpoint struct {
Mode string `json:"mode"` // auto | manual
Host string `json:"host"`
Port int `json:"port"`
Endpoint string `json:"endpoint"`
ManualHost string `json:"manualHost,omitempty"`
SuggestedLAN string `json:"suggestedLAN,omitempty"`
Source string `json:"source"` // manual, lan_listener, all_interfaces, external_listener, loopback, default
}
DeviceEndpoint is the host:port clients on the LAN should use for proxy setup.
func ResolveDeviceProxyEndpoint ¶ added in v0.22.0
func ResolveDeviceProxyEndpoint(addrs []string, mode, manualHost string) DeviceEndpoint
ResolveDeviceProxyEndpoint picks the best client-facing proxy address from active listeners. Auto mode prefers a LAN listener on the suggested interface IP, then all-interfaces binds mapped to that LAN IP, then any external listener, then loopback for simulator-only setups.
type Hub ¶
type Hub struct {
// SyncSelfPorts updates proxy SelfPorts and hub control address after a listener rebind.
SyncSelfPorts func()
// Upstream applies a chained upstream-proxy URL ("" = direct). Set by cmd.
Upstream func(string) error
// SetCaptureScopeOnly toggles persisting only in-scope traffic. Set by cmd.
SetCaptureScopeOnly func(bool)
// SetSuppressBrowserTelemetry toggles suppression of Chrome/Firefox telemetry. Set by cmd.
SetSuppressBrowserTelemetry func(bool)
// SetInvisibleProxy toggles transparent/invisible proxy mode. Set by cmd.
SetInvisibleProxy func(bool)
// SetTLSBypassHosts replaces the list of hosts tunneled raw (no MITM). Set by cmd.
SetTLSBypassHosts func([]string)
// SetAutoBypassOnPinFailure toggles auto-adding a host to the bypass list on
// an MITM handshake failure (SSL pinning). Set by cmd.
SetAutoBypassOnPinFailure func(bool)
// ChecksDir holds user-authored Starlark scanner checks (global, shared across
// projects — typically ~/.interceptor/checks). Set by cmd.
ChecksDir string
// ActiveChecksDir holds user-authored Starlark ACTIVE checks (global, shared —
// typically ~/.interceptor/active-checks). Set by cmd.
ActiveChecksDir string
// ProjectName/ProjectDir identify the active project (Burp-style). Set by cmd;
// surfaced at GET /api/version so the UI can show which project is loaded.
ProjectName string
ProjectDir string
// GlobalDir is ~/.interceptor (named projects live in GlobalDir/projects).
// SwitchProject re-launches Interceptor into another project; nil if unsupported.
GlobalDir string
SwitchProject func(target string) error
// contains filtered or unexported fields
}
Hub is the control-plane HTTP handler and live-event broadcaster. It also implements the proxy's Events sink (FlowCaptured).
func New ¶
func New(st *store.Store, eng *intercept.Engine, ca *tlsca.CA, rebind Rebinder, sc *scope.Engine) *Hub
New builds a Hub. eng, ca, and rebind may be nil. If eng is non-nil, the hub registers itself as the intercept change notifier.
func (*Hub) FlowCaptured ¶
FlowCaptured implements proxy.Events: it pushes a newly-seen flow (request sent, response not yet known) to all live UI subscribers. Concurrency-safe.
func (*Hub) FlowUpdated ¶ added in v0.3.0
FlowUpdated implements proxy.Events: it pushes the filled-in flow (response or error now known) so the UI can update the existing history row in place.
func (*Hub) GetSelfAddr ¶ added in v0.20.0
func (*Hub) Handler ¶
Handler returns the control-plane HTTP handler, wrapped in the loopback/CSRF security guard (see securityGuard).
func (*Hub) NotifyBypassAdded ¶ added in v0.27.0
NotifyBypassAdded persists an updated TLS-bypass host list (produced when the proxy auto-bypasses a pinned host) and pushes a settings refresh to the UI. Wired as the proxy's OnBypassAdded callback; safe to call from proxy goroutines.
func (*Hub) SetControlRebinder ¶ added in v0.18.0
SetControlRebinder attaches the control-plane listener manager (set by cmd).
func (*Hub) SetSelfAddr ¶ added in v0.20.0
type MultiProxyRebinder ¶ added in v0.22.0
MultiProxyRebinder supports multiple proxy listeners sharing one handler.
Source Files
¶
- active_checks.go
- activescan.go
- activescan_csrf.go
- activity.go
- ai.go
- ai_agent.go
- ai_disabled.go
- analyze.go
- android.go
- api.go
- api_types.go
- authz.go
- authz_flowauth.go
- authz_helpers.go
- bodydecode.go
- checks.go
- checks_ai.go
- control.go
- curl.go
- decode.go
- device_endpoint.go
- device_endpoint_api.go
- diff.go
- discovery.go
- discovery_seeds.go
- endpoints_cache.go
- events.go
- external_projects.go
- findings.go
- flows_inscope.go
- fullproject.go
- guard.go
- har.go
- humaninput.go
- intruder.go
- ios.go
- ios_ssh.go
- mcpconfig.go
- network.go
- notes_ai.go
- oob.go
- oob_disabled.go
- params.go
- project.go
- projectnotes.go
- proxyaddrs.go
- readiness.go
- repeater.go
- retention.go
- routes_register.go
- scanner.go
- scope.go
- session.go
- sysproxy.go
- tlsdiag.go
- version.go
- views.go
- wordlist.go
- wsrepeater.go