Skip to content
Java API client for the Toxiproxy
Branch: master
Clone or download

Latest commit

Latest commit 9613ea6 Apr 2, 2019


Type Name Latest commit message Commit time
Failed to load latest commit information.
src Run toxiproxy in Docker during tests Apr 25, 2018
.gitignore Ignore IntelliJ files. Apr 20, 2016
.travis.yml Added .travis.yml Apr 25, 2018 Updated and Apr 25, 2018 Added license file #11 Apr 2, 2019 Updated and Apr 25, 2018
bnd.bnd Add OSGi metadata Apr 25, 2018
pom.xml [maven-release-plugin] prepare for next development iteration Apr 25, 2018


Build Status

This is a client library for the Toxiproxy - a proxy that simulates network and system conditions. With toxiproxy-java you may use a convenient Java API to create and manage proxies. Before you using this library, please read the Usage section of the Toxiproxy README.




By default, the ToxiproxyClient tries to connect to the http://localhost:8474. This might be changed using the parametrized constructor:

ToxiproxyClient client = new ToxiproxyClient("", 8474);

Following snippet will create a new proxy for the MySQL service:

Proxy mysqlProxy = client.createProxy("mysql", "localhost:21212", "localhost:3306");

The proxy will listen on port 21212 on the loopback interface and transfer all the traffic to port 3306. We may also create a toxic:

mysqlProxy.toxics().latency("my-latency-toxic", DOWNSTREAM, 100).setJitter(15);

For a full list of toxics, please visit the Toxiproxy README.

You can’t perform that action at this time.