Back to HTTP Traffic Capture

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:

📚 Documentation Overview

Integration Methods

GuideDescriptionBest For
Docker IntegrationContainer-based setup with docker-composeNew applications, development environments
Standalone IntegrationManual proxy configurationExisting applications, production environments

Language-Specific Guides

LanguageGuideFeatures
GoHTTP client setup, middleware, examplesnet/http, gin, fiber support
Pythonrequests, flask, fastapi integrationSession handling, async support
Node.jsaxios, express configurationProxy agents, middleware
General PatternsLanguage-agnostic conceptsUniversal proxy patterns

Reference Documentation

DocumentContents
Configuration ReferencePorts, environment variables, network architecture
Advanced FeaturesCustom headers, error handling, performance tuning
Troubleshooting GuideCommon issues, debugging, diagnostics
Quick ReferenceCommands, 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)

  • [ ] Review Docker Integration Guide
  • [ ] Configure your application's HTTP client for proxy: localhost:8082
  • [ ] Update your docker-compose.yml with network sharing
  • [ ] Test traffic capture at http://localhost:8090
  • Basic Setup (Standalone)

  • [ ] Review Standalone Integration Guide
  • [ ] Start mitmproxy with dual proxy modes
  • [ ] Configure your application for proxy usage
  • [ ] Verify traffic monitoring interface
  • 🎯 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

    PortServicePurpose
    8080Reverse ProxyIncoming client requests
    8081Your ApplicationApplication server
    8082Forward ProxyOutgoing API calls
    8090Web UITraffic 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?

    📖 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! 🚀

    © 2026 Jonathan Leahy · v1.0.12