Skip to content

feat: add HTTP forward proxy module with MITM support#327

Merged
butschster merged 2 commits intomasterfrom
feat/http-proxy-module
Apr 4, 2026
Merged

feat: add HTTP forward proxy module with MITM support#327
butschster merged 2 commits intomasterfrom
feat/http-proxy-module

Conversation

@butschster
Copy link
Copy Markdown
Member

What

Adds a new HTTP forward proxy module (modules/proxy/) that intercepts HTTP/HTTPS traffic, forwards it to the real destination, and captures full request + response pairs as http-dump events with additional proxy: true, duration_ms, and response fields.

Why

Enables language-agnostic HTTP traffic debugging — any HTTP client in any language can set Buggregator as its proxy to see all outgoing requests and their responses in the UI.

How

  • New modules/proxy/ with 4 files: module, server (tcp.Starter), certgen (in-memory CA), payload builder
  • HTTPS support via MITM: generates per-host TLS certs on the fly, signed by an ephemeral CA
  • Clients use InsecureSkipVerify / verify: false — no CA certificate installation needed
  • Events stored as http-dump type with extra response, proxy, duration_ms fields
  • Config: PROXY_ADDR env var, default :8080, added to TCPConfig
  • Registered in main.go alongside existing TCP modules

Testing

  • go build ./... — compiles clean
  • go test ./... -count=1 — all tests pass
  • go vet ./... — no issues
  • Manual: configure HTTP client with proxy http://localhost:8080, send requests, verify events appear in UI

Add a new TCP module that acts as an HTTP forward proxy, capturing
full request/response pairs and storing them as http-dump events.
Supports HTTPS via MITM with in-memory CA certificates.
Clients only need InsecureSkipVerify — no CA install required.
@butschster butschster added the enhancement New feature or request label Apr 4, 2026
@butschster butschster self-assigned this Apr 4, 2026
@butschster butschster moved this to In Progress in Buggregator Apr 4, 2026
@butschster butschster moved this from In Progress to Done in Buggregator Apr 4, 2026
@butschster butschster merged commit 9c1fa03 into master Apr 4, 2026
1 check passed
@butschster butschster deleted the feat/http-proxy-module branch April 4, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request module [Http-dump]

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add a universal "send anything" endpoint for debugging arbitrary payloads

1 participant