This project aims to centralize and organize custom rules for use with mitmproxy, a powerful tool for intercepting, inspecting, modifying, and replaying HTTP(S) traffic.
Key Features:
- Project-based Grouping: Organize rules into different projects.
- SQLite Storage: Rules are stored in a local SQLite database for persistence and easy management.
- Clone Feature: Quickly duplicate projects and their rules.
- Real-time Interception: Automate request and response manipulations for testing and debugging.
| Home | New Rule |
|---|---|
![]() |
![]() |
| Edit Rule | New Project |
|---|---|
![]() |
![]() |
-
Clone the repository:
git clone git@github.com:ViniciusAlberkovics/mitmproxy_rules.git cd mitmproxy_rules -
Install uv (if not already installed):
pip install uv
-
Install project dependencies using
uvandpyproject.toml:uv pip install -r pyproject.toml
Or, to install in editable/development mode:
uv pip install -e .Note: This project uses the
uvproject structure withpyproject.tomlanduv.lockfor dependency management. There is norequirements.txt. -
Install mitmproxy:
Follow the official instructions at mitmproxy installation guide.
You can run each component separately. Use the provided Makefile for convenience.
This will start mitmweb with the custom interceptor addon and load rules from the SQLite database:
make addonOr manually:
DB_FILE=$(pwd)/rules.db mitmweb -s addon/interceptor.py --listen-port 9000This will start the FastAPI backend for managing rules:
make backendOr manually:
DB_FILE=$(pwd)/rules.db uv run -- fastapi dev backend/api_server.pyThis will start a simple HTTP server to serve the frontend:
make frontendOr manually:
python -m http.server 8001 --directory frontendmitmproxy_rules/
├── addon/ # Addon scripts for mitmproxy (automate the rules)
├── backend/ # Backend API to manage rules (FastAPI)
├── frontend/ # Web interface to create/edit rules
├── shared/ # Utilities shared between backend and addon
├── rules.db # SQLite database containing projects and rules
├── README.md # Main project documentation
- addon/: Contains scripts that are loaded as addons in mitmproxy, applying the defined rules to intercepted traffic.
- backend/: Implements an API (using FastAPI) for reading, writing, and editing rules, facilitating integration with the frontend.
- frontend/: Web interface for viewing, creating, and editing rules in a user-friendly way.
- shared/: Utility functions and modules shared between the backend and addon, such as database interaction.
- README.md: This documentation file.



