Skip to main content
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

mitmweb
By default, mitmweb:
  • Listens on 127.0.0.1:8081 for web interface
  • Listens on 0.0.0.0:8080 for proxy traffic
  • Automatically opens browser to web interface

Command-Line Options

Web Interface Options

FlagDescription
--web-port PORTWeb interface port (default: 8081)
--web-host HOSTWeb interface host (default: 127.0.0.1)
--web-open-browserAutomatically open browser (default: true)
--no-web-open-browserDon’t open browser automatically

General Options

FlagDescription
--versionShow version number and exit
--optionsShow all options and their default values
--commandsShow all commands and their signatures
--set option[=value]Set an option
-q, --quietQuiet mode
-v, --verboseIncrease log verbosity

Proxy Options

FlagDescription
-p PORT, --listen-port PORTProxy service port (default: 8080)
--listen-host HOSTAddress to bind proxy to (default: 0.0.0.0)
-m MODE, --mode MODEProxy mode (regular, transparent, socks5, etc.)
-n, --serverDon’t connect to upstream servers
--ignore-hosts HOSTIgnore host(s) and pass through
--allow-hosts HOSTOnly intercept these hosts
--tcp-hosts HOSTGeneric TCP SSL proxy for these hosts

SSL Options

FlagDescription
--certs SPECSSL certificate specification
--cert-passphrase PASSPassphrase for SSL certificate
-k, --ssl-insecureDon’t verify upstream SSL/TLS certificates

File I/O

FlagDescription
-r PATH, --rfile PATHRead flows from file
-w PATH, --save-stream-file PATHStream flows to file
-s SCRIPT, --scripts SCRIPTExecute addon script(s)

Filtering & Interception

FlagDescription
--intercept FILTERIntercept filter expression

Replay Options

FlagDescription
-C PATH, --client-replay PATHReplay client requests
-S PATH, --server-replay PATHReplay server responses

Modification Options

FlagDescription
-M PATTERN, --map-remote PATTERNMap remote resources
--map-local PATTERNMap to local files
-B PATTERN, --modify-body PATTERNModify body
-H PATTERN, --modify-headers PATTERNModify headers

Web Interface Features

Flow List

The main view shows all captured HTTP flows:
1

View Traffic

Flows appear in real-time as they’re captured
  • Method (GET, POST, etc.)
  • URL path
  • Status code
  • Response size
  • Timing information
2

Select Flow

Click any flow to view full details:
  • Request headers and body
  • Response headers and body
  • Timing breakdown
  • WebSocket messages (if applicable)
3

Filter Flows

Use the search box to filter:
  • Domain names
  • Methods
  • Status codes
  • Content types

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

Per-flow actions:
  • Resume intercepted flow
  • Delete flow
  • Replay flow
  • Export flow (HAR, curl, etc.)
  • Revert modifications
Multiple flow actions:
  • Clear all flows
  • Resume all intercepted
  • Export selected flows
  • Filter and export

Examples

Start mitmweb and access via browser:
mitmweb
Automatically opens http://127.0.0.1:8081 in your browser.
Allow access from other machines on your network:
mitmweb --web-host 0.0.0.0 --web-port 8081
Access from other machines: http://<your-ip>:8081
Run on different ports to avoid conflicts:
mitmweb --web-port 9000 -p 9080
  • Web UI: http://localhost:9000
  • Proxy: localhost:9080
Run without opening browser (for servers):
mitmweb --no-web-open-browser --web-host 0.0.0.0
Start with interception filter:
mitmweb --set intercept="~d api.example.com"
Requests to api.example.com will pause for inspection.
View previously captured traffic:
mitmweb -r traffic.mitm
Capture and view simultaneously:
mitmweb -w session.mitm
Run with custom addon:
mitmweb -s my_addon.py

Filter Expressions

mitmweb supports filter expressions in the search box:
~d example.com

Common Filters

FilterDescriptionExample
~dDomain~d example.com
~mMethod~m GET
~uURL~u "/api/"
~cStatus code~c 200
~tContent type~t "text/html"
~hHeader~h "Authorization"
~bBody~b "error"
~qRequest~q
~sResponse~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:
HTTP Archive format, compatible with many tools:
  1. Select flow(s)
  2. Click Export
  3. Choose “HAR”
  4. Import into browser DevTools, Postman, etc.

Remote Debugging Setup

Mobile Device Testing

1

Start mitmweb

mitmweb --web-host 0.0.0.0
2

Configure Mobile Proxy

On your mobile device:
  • Wi-Fi settings → Proxy
  • Manual proxy
  • Host: Your computer’s IP
  • Port: 8080
3

Access Web Interface

From any browser on your network:
http://<computer-ip>:8081
4

View Traffic

Mobile app traffic appears in real-time in the web interface.

Team Collaboration

# On shared server
mitmweb --web-host 0.0.0.0 --web-port 8081 -p 8080

Security Considerations

Public network exposureBy default, --web-host 0.0.0.0 makes the web interface accessible to anyone on your network. Use authentication or firewall rules to restrict access.
Recommended for remote access:
  1. Use SSH tunneling:
    ssh -L 8081:localhost:8081 user@remote-server
    
  2. Or set up authentication:
    mitmweb --set web_auth=username:password
    

Use Cases

API Development

1

Start mitmweb

mitmweb --set intercept="~d api.example.com"
2

Make API Calls

Configure your app to use proxy, make requests
3

Inspect in Browser

View formatted JSON, headers, timing in web UI
4

Export for Documentation

Export as cURL or HAR for API documentation

Testing Mobile Apps

# Start mitmweb for mobile testing
mitmweb --web-host 0.0.0.0 --set console_eventlog_verbosity=error
  • Configure mobile device proxy
  • Use app normally
  • Monitor traffic in browser
  • Debug API issues

Demonstrating HTTP Issues

# Record problematic session
mitmweb -w problem-session.mitm

# Share web interface URL with team
# or export flows to share

Automated Testing Integration

import subprocess
import requests
import time

# Start mitmweb
proc = subprocess.Popen(["mitmweb", "--no-web-open-browser"])
time.sleep(2)

# Run tests through proxy
proxies = {"http": "http://localhost:8080", "https": "http://localhost:8080"}
response = requests.get("http://example.com", proxies=proxies)

# View captured traffic at http://localhost:8081
input("Check web interface, then press Enter to stop...")

proc.terminate()

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:
KeyAction
/Focus search box
Navigate flows
EnterView selected flow
EscClose flow details
rResume flow
xDelete flow

Performance Tips

For high-traffic scenarios:
  • Use filters to reduce displayed flows
  • Periodically clear old flows
  • Limit saved flows with --set view_filter
  • Consider using mitmdump for pure logging
mitmweb --set view_filter="~d api.example.com"

Troubleshooting

Solution:
  1. Check web interface is running:
    curl http://localhost:8081
    
  2. Verify port isn’t blocked:
    netstat -an | grep 8081
    
  3. Try different port:
    mitmweb --web-port 9000
    
Check:
  1. Proxy is configured correctly (port 8080)
  2. Certificate is installed
  3. No filters active (clear search box)
  4. Flows aren’t being ignored (--ignore-hosts)
The web interface uses WebSocket for real-time updates.Fix:
  • Refresh browser
  • Check firewall/proxy settings
  • Try different browser
Reduce memory:
  1. Clear flows regularly
  2. Use filters to limit flows
  3. Don’t keep web interface open when not needed

Comparison with Other Tools

Featuremitmwebmitmproxymitmdump
InterfaceWeb browserTerminal UICommand-line
Remote accessYesNoNo
InteractivityClick-basedKeyboardNone
Best forTeams, demosPower usersAutomation
Resource usageMediumMediumLow
ExportMultiple formatsVia commandsVia scripts

Integration Examples

Docker Deployment

FROM mitmproxy/mitmproxy:latest

EXPOSE 8080 8081

CMD ["mitmweb", "--web-host", "0.0.0.0", "--no-web-open-browser"]

Kubernetes Deployment

apiVersion: v1
kind: Pod
metadata:
  name: mitmweb
spec:
  containers:
  - name: mitmweb
    image: mitmproxy/mitmproxy:latest
    command: ["mitmweb"]
    args:
      - "--web-host"
      - "0.0.0.0"
      - "--no-web-open-browser"
    ports:
    - containerPort: 8080  # Proxy
    - containerPort: 8081  # Web UI

See Also

mitmproxy

Interactive TUI for advanced workflows

mitmdump

Command-line tool for automation

Build docs developers (and LLMs) love