Toxiproxy sits between clients and upstream services so tests can add latency, outages, and other faults over HTTP.
Overview
Toxiproxy is a framework for simulating network conditions in testing, CI, and development. A Go TCP proxy accepts application traffic while a client adjusts behavior through an HTTP API, supporting deterministic tampering and randomized chaos.
Typical setup routes test connections through configured proxies, then enables or disables links or attaches toxics such as latency, bandwidth limits, timeouts, packet loss, and connection resets. Proxies are defined with listen addresses, upstream targets, and names so multiple applications can share one instance.
The HTTP API on port 8474 manages proxies and toxics; optional auth uses a bearer token. Metrics are exposed for Prometheus-style scraping. Client libraries exist for several languages, and a CLI can create proxies and adjust toxics from the shell.
Binaries and packages are published for Linux, macOS, and Windows, including Homebrew and MacPorts on macOS. Images are published on the GitHub container registry, and the server can be built from source with Go.
Key features
- TCP proxy with HTTP control API
- Latency, bandwidth, and timeout toxics
- Packet loss and connection reset simulation
- Proxy enable and disable for outages
- Bulk populate endpoint for configs
- Prometheus-compatible metrics
- Optional API bearer authentication
- Cross-platform binaries and containers
Use cases
- Proving resilience in integration tests
- Simulating database or cache outages
- Injecting latency in CI pipelines
- Chaos testing microservice links