Introduction
GoReplay captures live HTTP traffic from production servers and replays it against staging or test environments without requiring code changes, proxies, or complex infrastructure. It operates at the network level, giving teams confidence that deployments behave correctly under real traffic patterns.
What GoReplay Does
- Captures HTTP requests at the network layer using raw sockets or pcap
- Replays captured traffic to one or multiple target servers in real-time or from recorded files
- Supports traffic filtering by URL patterns, headers, and HTTP methods
- Allows rate-limiting and speed-adjustment of replayed traffic
- Provides middleware support for modifying requests during replay via stdin/stdout piping
Architecture Overview
GoReplay runs as a single binary that attaches to a network interface via raw sockets (Linux) or libpcap. It reconstructs TCP streams into HTTP requests, then forwards them to configured outputs: files, HTTP endpoints, or Kafka topics. The middleware system pipes each request through an external process for transformation before replay, enabling header rewriting, authentication injection, or data masking.
Self-Hosting & Configuration
- Download a prebuilt binary from GitHub releases; no dependencies required
- Requires root/sudo for raw socket access on the capture side
- Configure input (raw port, file, or TCP) and output (http, file, kafka, stdout) via CLI flags
- Use
--http-allow-urland--http-disallow-urlregex filters to scope captured traffic - Set
--output-http-workersto control concurrency of replay connections
Key Features
- Zero-dependency single binary that requires no code instrumentation
- Real-time replay with configurable speed multiplier (1x, 2x, or throttled)
- Multi-output support: replay to multiple staging environments simultaneously
- Middleware pipeline for request transformation via any language
- Kafka integration for buffering and distributed replay architectures
Comparison with Similar Tools
- tcpreplay — replays raw packets at layer 2/3; GoReplay operates at HTTP layer with request-level intelligence
- Locust/k6 — synthetic load generators; GoReplay uses actual production traffic patterns
- mitmproxy — interactive proxy requiring client configuration; GoReplay is transparent and non-intrusive
- Vegeta — constant-rate HTTP load testing; GoReplay preserves realistic traffic distribution
FAQ
Q: Does GoReplay affect production server performance? A: Minimal impact. It reads packets passively from raw sockets without proxying or modifying production traffic flow.
Q: Can I replay HTTPS traffic? A: GoReplay captures encrypted traffic if you provide the TLS private key, or you can terminate TLS before the capture point.
Q: How do I handle authentication tokens that expire? A: Use the middleware system to rewrite Authorization headers during replay, injecting valid staging credentials.
Q: Does it support HTTP/2? A: GoReplay primarily targets HTTP/1.1. HTTP/2 support is experimental and requires h2c (cleartext) connections.