Skip to content

Instantly share code, notes, and snippets.

@Nerahikada
Created October 6, 2024 09:36
Show Gist options
  • Save Nerahikada/4cf30ab5eb280a0c5b7955a298b2d95e to your computer and use it in GitHub Desktop.
Save Nerahikada/4cf30ab5eb280a0c5b7955a298b2d95e to your computer and use it in GitHub Desktop.
run mitmproxy with tailscale (docker compose)
services:
tailscale:
image: tailscale/tailscale:latest
environment:
- TS_HOSTNAME=mitmproxy
- TS_STATE_DIR=/var/lib/tailscale
- TS_USERSPACE=false
volumes:
- ./tailscale:/var/lib/tailscale
- /dev/net/tun:/dev/net/tun
cap_add:
- net_admin
- sys_module
restart: unless-stopped
mitmproxy:
image: mitmproxy/mitmproxy
depends_on:
- tailscale
network_mode: service:tailscale
volumes:
- ./mitmproxy:/home/mitmproxy/.mitmproxy
command: mitmweb --web-host 0.0.0.0
restart: unless-stopped
mitmweb-proxy:
image: haproxy:lts-alpine
depends_on:
- mitmproxy
network_mode: service:tailscale
volumes:
- ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
restart: unless-stopped
defaults
log stdout format raw local0 info
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
frontend main
bind *:80
default_backend mitmproxy
backend mitmproxy
timeout tunnel 1h
server mitmweb 127.0.0.1:8081 check
http-request set-header Host 127.0.0.1:8081
http-request set-header Origin http://127.0.0.1:8081
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment