See every API call your Go service makes
To see the API calls your Go service makes, give its http.Client a Transport with Proxy: http.ProxyURL(...) set to Buggregator's proxy on port 8080, and InsecureSkipVerify: true. Every call then goes through Buggregator, and the UI shows the request, the response, the status code and the response time. Use it in development only: TLS verification is off.
Steps
1. Start Buggregator with the proxy port
The proxy listens on port 8080; the UI is on port 8000. Keep the proxy on your 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. Send requests through the proxy
Build a client with a proxied transport. In Docker Compose, replace 127.0.0.1 with the Buggregator service name, for example buggregator.
import (
"crypto/tls"
"net/http"
"net/url"
)
proxyURL, _ := url.Parse("http://127.0.0.1:8080")
client := &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyURL(proxyURL),
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
},
}
resp, err := client.Get("https://api.example.com/users")Use this client wherever your service calls an API.
3. Read the request and response
Open http://127.0.0.1:8000. Proxied calls carry a purple proxy badge. The detail page has Response, Request and Raw tabs, a JSON tree for the response body, and a color-coded status code.
Why it works
For HTTPS, the proxy answers the CONNECT handshake with a certificate for the target host, signed by a CA it keeps in memory, then forwards the request to the real server. Go would reject that certificate, which is why the client skips verification; no CA installation is needed. The CA is created at startup and never written to disk.
Related tips
- 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 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 request axios sends
Pass an HttpsProxyAgent to axios and turn off its own proxy. Each outgoing request and its response shows up in Buggregator. For local work only.
- Sentry
Go errors from sentry-go on your machine
Set the sentry-go DSN to Buggregator. Errors and panics from your Go service show up locally with their stack traces, and nothing goes to the cloud.
Checked on with Buggregator v2.13.0