Testing API Resilience with Curl & Chaos Proxy on MacOS
You don't always need a complex UI or a mobile device to test how your API handles failures. Sometimes, you just want to run a quick curl command in your terminal to see if your backend handles a 503 error or a 7-second delay correctly.
In this guide, we'll set up a Chaos Proxy rule and route our terminal traffic through it.
Need a UI for this? If you prefer GUI tools over terminal, read our guide on Proxyman vs Charles Proxy alternatives.
Step 1: Configure the Chaos Rule
First, we need to tell Debuggo what to break. Log in to your dashboard and create a new rule with the following parameters:
- Rule NameChaos Test 1
- URL Pattern (Regex)
httpbin.org(Matches any URL containing this string) - Delay7 seconds (Simulates lag)
- Failure Rate1 (100% of requests will fail)
- Error CodePro503 (Service Unavailable)
- MethodProGET (Optional)
Step 2: Start the Session
Click the Start button in the dashboard. Debuggo will spin up a dedicated cloud proxy instance for you.
Step 3: Trust the Certificate (MacOS)
To inspect HTTPS traffic (like https://httpbin.org), you need to trust the Debuggo CA certificate locally.
- Download
mitmproxy-ca-cert.pemfrom the dashboard. - Open Keychain Access on your Mac.
- Drag and drop the file into the System keychain.
- Double click the certificate, expand "Trust", and select "Always Trust".
Step 4: Run the Command
Now, use curl with the -x flag to route traffic through Debuggo. Copy your specific credentials from the dashboard.
What to expect:
- You will see a 7-second delay before the response.
- You will see
HTTP/2 503 Service Unavailableinstead of 200 OK. - The
-vflag will show you the full headers, confirming the traffic went through the proxy.
Next Step: Simulate backend failures. Read Stop Testing Success. Kill the Database.
Still testing manually?
Automate network resilience testing with Debuggo AI. Generate UI and API tests in minutes.