mitmproxy-linux (Local Traffic Redirector for mitmproxy)
mitmproxy-linux is a component package within the broader mitmproxy ecosystem, currently at version 0.12.9, which was last released on January 30, 2026. It specifically provides the Linux traffic redirection capabilities for mitmproxy's 'local capture mode', leveraging eBPF technology to intercept traffic from specific applications without system-wide proxy settings. This package is not a standalone proxy but rather a backend dependency used by the main mitmproxy tools (mitmproxy, mitmweb, mitmdump) to enable advanced local interception features on Linux. The mitmproxy project itself has a regular release cadence, with the main library currently at version 12.2.1 as of November 24, 2025.
Warnings
- breaking Local capture mode (which relies on mitmproxy-linux) requires root privileges (`sudo`) to load the eBPF program, as it interacts with the Linux kernel at a low level.
- gotcha mitmproxy-linux relies on eBPF instrumentation, which requires a reasonably recent Linux kernel. Official support is for Linux 6.8 and above (e.g., Ubuntu 22.04). Older kernels may not function correctly.
- gotcha The local capture mode on Linux, facilitated by mitmproxy-linux, currently only supports capturing outbound (egress) connections. For inbound connections, other proxy modes like reverse proxy mode are recommended.
- gotcha The `mitmproxy-linux` package itself does not provide a direct user-facing Python API for scripting. Its role is infrastructural. User scripting is done via the main `mitmproxy` package's addon API (e.g., `from mitmproxy import http`).
Install
-
pip install mitmproxy-linux -
pip install mitmproxy
Imports
- mitmproxy-linux
This package is primarily a backend dependency; direct Python imports for user-facing functionality are not typically performed by end-users. Its features are exposed via the mitmproxy CLI, e.g., 'mitmproxy --mode local'.
- http
from mitmproxy import http
Quickstart
# To enable mitmproxy's local capture mode using mitmproxy-linux: # Ensure mitmproxy is installed (pip install mitmproxy) # Run mitmproxy with the local mode flag: sudo mitmproxy --mode local # To capture traffic from a specific application (e.g., curl): sudo mitmproxy --mode local:curl # Or, for the web interface: sudo mitmweb --mode local