See every request axios sends
Give axios an HttpsProxyAgent that points at Buggregator's proxy on port 8080, and set proxy: false. Start Node with NODE_TLS_REJECT_UNAUTHORIZED=0. Every axios request then shows up in Buggregator with its headers, body, response, status code and time. TLS checks are off, so keep it to local development.
Steps
1. Start Buggregator with the proxy port
Port 8000 is the UI, port 8080 is the proxy. Bind the proxy to this machine only: it forwards to any host.
docker run --pull always \
-p 127.0.0.1:8000:8000 \
-p 127.0.0.1:8080:8080 \
ghcr.io/buggregator/server:latest2. Add the agent package
npm install https-proxy-agent3. Send axios through the proxy
proxy: false turns off axios's own proxy handling, so the agent does the work.
import axios from 'axios'
import { HttpsProxyAgent } from 'https-proxy-agent'
const agent = new HttpsProxyAgent('http://127.0.0.1:8080')
const response = await axios.get('https://api.example.com/users', {
httpsAgent: agent,
proxy: false,
})In Docker Compose, use the service name: http://buggregator:8080.
4. Turn off the certificate check
https-proxy-agent does not pass rejectUnauthorized on to the target site. Turn the check off for the whole process when you start it.
NODE_TLS_REJECT_UNAUTHORIZED=0 node app.js5. Read the request and the response
Open http://127.0.0.1:8000. Each call shows the full URL, request and response headers and body, a color-coded status code and the response time in milliseconds. JSON bodies open as a tree.
Why it works
Buggregator's proxy sits between your app and the API. It forwards each request to the real server and records both directions. For HTTPS it makes a certificate for the target host on the fly, signed by a CA kept in memory. That is why Node must skip the certificate check.
Related tips
- HTTP
See every API call your Laravel app sends
Set global proxy options for Laravel's HTTP client in AppServiceProvider. Every Http:: request and response shows up in Buggregator. Local only.
- HTTP
See every API call your Python script makes
Route Python requests through Buggregator's HTTP proxy on port 8080. See each request and response with status code and timing. Dev only.
- HTTP
See every API call your Go service makes
Give your Go http.Client a Transport that uses Buggregator's proxy on port 8080. See each request and response with status code and timing. Dev only.
- Sentry
Express errors and traces locally with @sentry/node
Point @sentry/node at Buggregator and load it before Express. Route errors, request traces and logs of your Express app show up on your machine.
Checked on with Buggregator v2.13.0