npx skills add ...
npx skills add factory-ai/factory-plugins --skill http-toolkit-intercept
npx skills add factory-ai/factory-plugins --skill http-toolkit-intercept
Intercept and debug HTTP traffic from any CLI, service, or script using HTTP Toolkit. Use when you need to inspect LLM API calls, backend requests, auth flows, or debug network-level issues across any language or runtime.
Use this skill when you need authoritative evidence of what your program sent to a remote API and what it received back while verifying a code change. Works across any runtime — Node.js, Bun, Deno, Python, Go, Ruby, Java/JVM, .NET, PHP, Rust, shell scripts, etc. — as long as the process respects a proxy.
The reliable pattern is:
--output-format json, debug logging, or structured stdout).Do not rely on TUI screenshots alone when the question is about request payloads, auth headers, or wire-level behavior.
On Linux/headless environments, plain httptoolkit often fails due to sandbox/X11 issues. Prefer:
If a stale server is already running on ports 45456/45457, stop it first:
The canonical env vars most runtimes honor:
Some runtimes require an extra env var or flag — see the "Runtime proxy matrix" below.
If the HTTP Toolkit CA is not trusted by your runtime, TLS verification will fail. See "TLS Safety" below. Disabling TLS verification is appropriate only for controlled local debugging.
If your program supports a machine-readable output mode (e.g. --output-format stream-json, --json, --log-level debug, structured stdout, or writing to a file), pipe it to a file:
Either:
Together they answer: "what did we send?" and "what did we do with the response?"
The critical correct pathways that proved reliable were:
Use a non-interactive / exec mode, not the TUI, when verifying payloads
--output-format, --json, --headless, --batch).Treat outbound and inbound as separate evidence sources
Set the proxy env vars your specific runtime honors
HTTP_PROXY/HTTPS_PROXY cover most runtimes, but some (e.g. Bun, Java) require extra vars or flags.Disable TLS verification only for controlled local debugging when needed
Keep runs bounded
| Runtime | Proxy env vars / flags | TLS bypass (local dev only) |
|---|---|---|
| Node.js | HTTP_PROXY, HTTPS_PROXY, NO_PROXY (most libraries); some HTTP clients need --proxy flags or explicit agent: option | NODE_TLS_REJECT_UNAUTHORIZED=0 or NODE_EXTRA_CA_CERTS=/path/to/ca.pem |
| Bun | BUN_CONFIG_PROXY (mandatory — plain HTTP_PROXY/HTTPS_PROXY are silently ignored for Bun's own fetch) | NODE_TLS_REJECT_UNAUTHORIZED=0 |
| Deno | HTTP_PROXY, HTTPS_PROXY | --unsafely-ignore-certificate-errors |
Python (requests, httpx) | HTTP_PROXY, HTTPS_PROXY, ALL_PROXY | REQUESTS_CA_BUNDLE / SSL_CERT_FILE pointing at the HTTP Toolkit CA, or verify=False in code |
Python (urllib) | Same env vars | SSL_CERT_FILE or disable context verification |
Go (net/http) | HTTP_PROXY, HTTPS_PROXY, NO_PROXY (honored via http.ProxyFromEnvironment) | SSL_CERT_FILE or InsecureSkipVerify: true in the transport |
| Ruby | HTTP_PROXY, HTTPS_PROXY | SSL_CERT_FILE, or OpenSSL::SSL::VERIFY_NONE |
| Java / JVM | -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8000 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8000; env vars are not honored by the JVM | Import CA into a truststore and pass -Djavax.net.ssl.trustStore=... |
| .NET / C# | HTTP_PROXY, HTTPS_PROXY, ALL_PROXY (on recent runtimes) or configure HttpClient explicitly | Trust CA in OS store, or HttpClientHandler.ServerCertificateCustomValidationCallback |
| PHP (curl / cli) | HTTP_PROXY, HTTPS_PROXY (or per-call CURLOPT_PROXY) | CURLOPT_SSL_VERIFYPEER => false |
Rust (reqwest) | HTTP_PROXY, HTTPS_PROXY | danger_accept_invalid_certs(true) on the client |
| curl / shell | HTTP_PROXY, HTTPS_PROXY env vars or -x/--proxy flag | -k / --insecure |
| Docker containers | Pass env vars through with -e HTTP_PROXY=...; use host.docker.internal (Mac/Win) or --network=host (Linux) so the container can reach the proxy | Mount the CA into the image and install it, or use runtime-specific bypass flags |
Prefer trusting the HTTP Toolkit CA in your runtime/OS trust store over disabling verification. Bypass flags should be local-dev only.
If your program emits newline-delimited JSON, use jq:
Adjust the filter to match your program's event schema. For plain-text logs, use rg/grep patterns.
Sort both streams by timestamp, then interleave them. The sequence usually looks like:
If a program log shows an outbound request that HTTP Toolkit didn't capture, that's a proxy-config bug.
| Problem | Cause | Fix |
|---|---|---|
| Program hangs, no events after startup | Proxy env vars not reaching the process, or TLS verification blocking | Re-run with the right env vars for your runtime (see matrix); if necessary, enable the runtime's TLS bypass in dev |
ECONNRESET / connection reset on every request | Runtime-specific proxy env var missing (e.g. BUN_CONFIG_PROXY for Bun, JVM -D flags for Java) | Use the correct runtime-specific proxy config |
| TLS cert errors via proxy | MITM CA not trusted by this runtime | Trust HTTP Toolkit CA in the runtime / OS store, or enable the runtime's TLS bypass in dev only |
HTTP Toolkit API 403s on /config | Auth-gated config endpoint | Treat 200/401/403 as reachable; only connection failure means the server is dead |
| Export has outbound data but no matching inbound events | Didn't capture the program log | Add > /tmp/session.log redirection to the launch |
| HTTP Toolkit misses the first request | Started capturing after the process launched | Start HTTP Toolkit first, THEN launch the program |
Container / VM can't reach 127.0.0.1:8000 | Loopback is container-local | Use host.docker.internal (Docker Desktop) or --network=host (Linux) |
| Program ignores env vars entirely | Runtime doesn't honor env vars (e.g. JVM) | Use runtime-specific flags (-Dhttp.proxyHost=... for JVM, etc.) |
HTTP_PROXY="http://127.0.0.1:8000" \
HTTPS_PROXY="http://127.0.0.1:8000" \
ALL_PROXY="http://127.0.0.1:8000" \
NO_PROXY="" \
<your-program> <args><your-program> exec --output-format stream-json "your input" \
> /tmp/session-stdout.log 2> /tmp/session-stderr.logjq -c 'select(.type == "tool_call" or .type == "message")' /tmp/session-stdout.logoutbound POST /api/endpoint (from HTTP Toolkit)
inbound event received (from program log)
inbound follow-up action (from program log)
outbound POST /api/endpoint (next request)