mitmweb is a web-based interface for mitmproxy. It provides a browser-accessible UI for inspecting and manipulating HTTP traffic, perfect for remote access and collaborative debugging.
Overview
mitmweb offers:- Browser-based UI - Access from any modern web browser
- Remote access - Monitor traffic from anywhere on your network
- Familiar interface - Web UI with standard browser controls
- Real-time updates - Live traffic view via WebSocket
- Export capabilities - Download flows in various formats
- Search and filter - Powerful query interface
Basic Usage
By default, mitmweb:
- Listens on
127.0.0.1:8081for web interface - Listens on
0.0.0.0:8080for proxy traffic - Automatically opens browser to web interface
Command-Line Options
Web Interface Options
| Flag | Description |
|---|---|
--web-port PORT | Web interface port (default: 8081) |
--web-host HOST | Web interface host (default: 127.0.0.1) |
--web-open-browser | Automatically open browser (default: true) |
--no-web-open-browser | Don’t open browser automatically |
General Options
| Flag | Description |
|---|---|
--version | Show version number and exit |
--options | Show all options and their default values |
--commands | Show all commands and their signatures |
--set option[=value] | Set an option |
-q, --quiet | Quiet mode |
-v, --verbose | Increase log verbosity |
Proxy Options
| Flag | Description |
|---|---|
-p PORT, --listen-port PORT | Proxy service port (default: 8080) |
--listen-host HOST | Address to bind proxy to (default: 0.0.0.0) |
-m MODE, --mode MODE | Proxy mode (regular, transparent, socks5, etc.) |
-n, --server | Don’t connect to upstream servers |
--ignore-hosts HOST | Ignore host(s) and pass through |
--allow-hosts HOST | Only intercept these hosts |
--tcp-hosts HOST | Generic TCP SSL proxy for these hosts |
SSL Options
| Flag | Description |
|---|---|
--certs SPEC | SSL certificate specification |
--cert-passphrase PASS | Passphrase for SSL certificate |
-k, --ssl-insecure | Don’t verify upstream SSL/TLS certificates |
File I/O
| Flag | Description |
|---|---|
-r PATH, --rfile PATH | Read flows from file |
-w PATH, --save-stream-file PATH | Stream flows to file |
-s SCRIPT, --scripts SCRIPT | Execute addon script(s) |
Filtering & Interception
| Flag | Description |
|---|---|
--intercept FILTER | Intercept filter expression |
Replay Options
| Flag | Description |
|---|---|
-C PATH, --client-replay PATH | Replay client requests |
-S PATH, --server-replay PATH | Replay server responses |
Modification Options
| Flag | Description |
|---|---|
-M PATTERN, --map-remote PATTERN | Map remote resources |
--map-local PATTERN | Map to local files |
-B PATTERN, --modify-body PATTERN | Modify body |
-H PATTERN, --modify-headers PATTERN | Modify headers |
Web Interface Features
Flow List
The main view shows all captured HTTP flows:View Traffic
Flows appear in real-time as they’re captured
- Method (GET, POST, etc.)
- URL path
- Status code
- Response size
- Timing information
Select Flow
Click any flow to view full details:
- Request headers and body
- Response headers and body
- Timing breakdown
- WebSocket messages (if applicable)
Flow Details
When viewing a flow, you can:Request Tab
- View HTTP method and URL
- Inspect request headers
- View request body (formatted)
- See query parameters
Response Tab
- View status code and reason
- Inspect response headers
- View response body (formatted)
- Check content type
Timing Tab
- Connection timing
- Request/response times
- Total duration
WebSocket Tab
- WebSocket messages
- Message direction
- Message content
Actions
Flow Actions
Flow Actions
Per-flow actions:
- Resume intercepted flow
- Delete flow
- Replay flow
- Export flow (HAR, curl, etc.)
- Revert modifications
Bulk Actions
Bulk Actions
Multiple flow actions:
- Clear all flows
- Resume all intercepted
- Export selected flows
- Filter and export
Examples
Basic Setup
Basic Setup
Start mitmweb and access via browser:Automatically opens
http://127.0.0.1:8081 in your browser.Remote Access
Remote Access
Allow access from other machines on your network:Access from other machines:
http://<your-ip>:8081Custom Ports
Custom Ports
Run on different ports to avoid conflicts:
- Web UI:
http://localhost:9000 - Proxy:
localhost:9080
Headless Server
Headless Server
Run without opening browser (for servers):
With Interception
With Interception
Start with interception filter:Requests to
api.example.com will pause for inspection.Load Saved Traffic
Load Saved Traffic
View previously captured traffic:
Save While Viewing
Save While Viewing
Capture and view simultaneously:
With Python Script
With Python Script
Run with custom addon:
Filter Expressions
mitmweb supports filter expressions in the search box:Common Filters
| Filter | Description | Example | ||
|---|---|---|---|---|
~d | Domain | ~d example.com | ||
~m | Method | ~m GET | ||
~u | URL | ~u "/api/" | ||
~c | Status code | ~c 200 | ||
~t | Content type | ~t "text/html" | ||
~h | Header | ~h "Authorization" | ||
~b | Body | ~b "error" | ||
~q | Request | ~q | ||
~s | Response | ~s | ||
& | And | ~d example.com & ~m POST | ||
| ` | ` | Or | `~c 200 | ~c 304` |
! | Not | !~d cdn.example.com |
Export Formats
mitmweb can export flows in multiple formats:- HAR
- cURL
- Raw
HTTP Archive format, compatible with many tools:
- Select flow(s)
- Click Export
- Choose “HAR”
- Import into browser DevTools, Postman, etc.
Remote Debugging Setup
Mobile Device Testing
Configure Mobile Proxy
On your mobile device:
- Wi-Fi settings → Proxy
- Manual proxy
- Host: Your computer’s IP
- Port: 8080
Team Collaboration
Security Considerations
Recommended for remote access:
-
Use SSH tunneling:
-
Or set up authentication:
Use Cases
API Development
Testing Mobile Apps
- Configure mobile device proxy
- Use app normally
- Monitor traffic in browser
- Debug API issues
Demonstrating HTTP Issues
Automated Testing Integration
Advanced Features
WebSocket Support
mitmweb automatically captures and displays WebSocket traffic:- View WebSocket handshake
- See all messages in/out
- Inspect message content
- Filter by message type
Content Views
Automatic content formatting:- JSON (formatted and syntax highlighted)
- XML/HTML (formatted)
- Images (rendered preview)
- Protocol buffers (if configured)
- Custom content types via addons
Keyboard Shortcuts
In the web interface:| Key | Action |
|---|---|
/ | Focus search box |
↑ ↓ | Navigate flows |
Enter | View selected flow |
Esc | Close flow details |
r | Resume flow |
x | Delete flow |
Performance Tips
Troubleshooting
Can't access web interface
Can't access web interface
Solution:
-
Check web interface is running:
-
Verify port isn’t blocked:
-
Try different port:
No flows appearing
No flows appearing
Check:
- Proxy is configured correctly (port 8080)
- Certificate is installed
- No filters active (clear search box)
- Flows aren’t being ignored (
--ignore-hosts)
WebSocket disconnected
WebSocket disconnected
The web interface uses WebSocket for real-time updates.Fix:
- Refresh browser
- Check firewall/proxy settings
- Try different browser
High memory usage
High memory usage
Reduce memory:
- Clear flows regularly
- Use filters to limit flows
- Don’t keep web interface open when not needed
Comparison with Other Tools
| Feature | mitmweb | mitmproxy | mitmdump |
|---|---|---|---|
| Interface | Web browser | Terminal UI | Command-line |
| Remote access | Yes | No | No |
| Interactivity | Click-based | Keyboard | None |
| Best for | Teams, demos | Power users | Automation |
| Resource usage | Medium | Medium | Low |
| Export | Multiple formats | Via commands | Via scripts |
Integration Examples
Docker Deployment
Kubernetes Deployment
See Also
mitmproxy
Interactive TUI for advanced workflows
mitmdump
Command-line tool for automation
