Overview
Advanced Echo Server is a lightweight, extensible Go application that mirrors HTTP requests with advanced control for testing. It supports:
- API Testing: Custom responses, headers, and status codes.
- Load Testing: Simulate latency and large payloads.
- Chaos Engineering: Inject random failures and errors.
- Real-Time Protocols: WebSockets and SSE.
- Observability: Prometheus metrics and structured logging.
Quick Start
Docker (Recommended)
# Pull and run
docker pull arun0009/advanced-echo-server:latest
docker run -p 8080:8080 arun0009/advanced-echo-server:latest
# Test basic echo
curl -X POST http://localhost:8080/ \
-H "Content-Type: application/json" \
-d '{"test": "hello"}'
Go
git clone https://github.com/arun0009/advanced-echo-server.git
cd advanced-echo-server
go run ./cmd/advanced-echo-server/main.go
Docker Compose
version: '3.8'
services:
echo-server:
image: arun0009/advanced-echo-server:latest
ports:
- "8080:8080"
environment:
- ECHO_CHAOS=10
- ECHO_DELAY=100ms
Test health: curl http://localhost:8080/health
Configuration
Control the server via environment variables (defaults) or HTTP headers (per-request). Dynamic scenarios update via API.
Variable | Description | Default | Example |
---|---|---|---|
PORT |
Server port | 8080 |
443 |
ENABLE_TLS |
Enable HTTPS | false |
true |
MAX_BODY_SIZE |
Max request body (bytes) | 10485760 |
5242880 |
ECHO_CHAOS |
Random failure % (0-100) | "" |
15 |
ECHO_RATE_LIMIT_RPS |
Global rate limit (RPS), 0 disables | 0 |
10 |
ECHO_RATE_LIMIT_BURST |
Burst size for rate limiter | 0 |
20 |
ECHO_SSE_TICKER |
SSE event interval (duration) | 5s |
500ms |
ECHO_HISTORY_SIZE |
Max stored requests | 100 |
500 |
ECHO_SCENARIO_FILE |
YAML scenarios path | scenarios.yaml |
/config/scenarios.yaml |