Back to HTTP Traffic Capture
[ ] Review Docker Integration Guide
[ ] Configure your application's HTTP client for proxy:
[ ] Update your docker-compose.yml with network sharing
[ ] Test traffic capture at http://localhost:8090 [ ] Review Standalone Integration Guide
[ ] Start mitmproxy with dual proxy modes
[ ] Configure your application for proxy usage
[ ] Verify traffic monitoring interface
Documentation
README
HTTP Traffic Monitoring System - Integration Guide
Welcome to the comprehensive integration guide for the mitmproxy-based HTTP traffic monitoring system. This documentation will help you integrate your own applications with the traffic monitoring infrastructure.
🚀 Quick Start
Choose your integration approach:
- 📦 Docker Compose Integration (Recommended) - Container-based integration with shared networking
- ⚡ Standalone Integration - Manual setup for existing applications
📚 Documentation Overview
Integration Methods
| Guide | Description | Best For |
|---|---|---|
| Docker Integration | Container-based setup with docker-compose | New applications, development environments |
| Standalone Integration | Manual proxy configuration | Existing applications, production environments |
Language-Specific Guides
| Language | Guide | Features |
|---|---|---|
| Go | HTTP client setup, middleware, examples | net/http, gin, fiber support |
| Python | requests, flask, fastapi integration | Session handling, async support |
| Node.js | axios, express configuration | Proxy agents, middleware |
| General Patterns | Language-agnostic concepts | Universal proxy patterns |
Reference Documentation
| Document | Contents |
|---|---|
| Configuration Reference | Ports, environment variables, network architecture |
| Advanced Features | Custom headers, error handling, performance tuning |
| Troubleshooting Guide | Common issues, debugging, diagnostics |
| Quick Reference | Commands, ports, variables cheat sheet |
🏗️ System Architecture
shell
┌─────────────┐ ┌─────────────────┐ ┌─────────────┐
│ Client │───▶│ mitmproxy │───▶│ Your App │
│ │ │ (port 8080) │ │ (port 8081) │
└─────────────┘ └─────────────────┘ └─────────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────┐
│ Web UI │ │ Forward │
│ (port 8090) │ │ Proxy │
└─────────────────┘ │ (port 8082) │
▲ └─────────────┘
│ │
└──────────────────────┘
External APIs
⚡ Getting Started Checklist
Prerequisites
- [ ] Docker and docker-compose installed (for Docker integration)
- [ ] Python 3.8+ with mitmproxy (for standalone integration)
- [ ] Your application ready for proxy configuration
Basic Setup (Docker)
localhost:8082Basic Setup (Standalone)
🎯 Key Integration Requirements
For Your Application
- Listen on port 8081 for incoming requests
- Use localhost:8082 as HTTP proxy for outgoing requests
- Disable SSL verification for HTTPS traffic through proxy
- Add X-Trace-Id headers for request correlation (optional)
Network Configuration
| Port | Service | Purpose |
|---|---|---|
| 8080 | Reverse Proxy | Incoming client requests |
| 8081 | Your Application | Application server |
| 8082 | Forward Proxy | Outgoing API calls |
| 8090 | Web UI | Traffic monitoring interface |
🔧 Quick Configuration Examples
Minimal Go Setup
go
proxyURL, _ := url.Parse("http://localhost:8082")
client := &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyURL(proxyURL),
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
},
}
Minimal Python Setup
python
import requests
session = requests.Session()
session.proxies = {'http': 'http://localhost:8082', 'https': 'http://localhost:8082'}
session.verify = False
Minimal Node.js Setup
javascript
const axios = require('axios');
const HttpsProxyAgent = require('https-proxy-agent');
const client = axios.create({
httpsAgent: new HttpsProxyAgent('http://localhost:8082'),
proxy: false
});
🧪 Testing Your Integration
Generate Test Traffic
bash
# Test incoming traffic capture
curl http://localhost:8080/your-endpoint
# View captured traffic
open http://localhost:8090
Verify Proxy Configuration
bash
# Test outgoing proxy
curl -x http://localhost:8082 https://httpbin.org/ip
# Check network connectivity
docker exec -it <container> netstat -tuln
🆘 Need Help?
- Issues with setup? → Troubleshooting Guide
- Want advanced features? → Advanced Features Guide
- Need quick reference? → Quick Reference
- Language-specific help? → Language Examples
📖 What's Inside
This documentation covers:
✅ Complete integration workflows for Docker and standalone setups ✅ Language-specific examples with working code samples ✅ Configuration reference for all settings and options ✅ Advanced patterns for production environments ✅ Troubleshooting guides for common issues ✅ Performance optimization tips and best practices
Ready to start? Choose your integration method above and dive in! 🚀