Labsco
Factory-AI logo

http-toolkit-intercept

โ˜… 90

by factory-ai ยท part of factory-ai/factory-plugins

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.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup
๐Ÿงฉ One of 7 skills in the factory-ai/factory-plugins package โ€” works on its own, and pairs well with its siblings.

This is the playbook your agent receives when the skill activates โ€” you don't need to read it to use the skill, but it's here to audit before installing.

HTTP Toolkit Intercept

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:

  1. Start HTTP Toolkit correctly.
  2. Run the program through the proxy in a mode that produces a machine-readable log (e.g. --output-format json, debug logging, or structured stdout).
  3. Export outbound HTTP requests from HTTP Toolkit.
  4. Pair the outbound HTTP export with the inbound program session log.

Do not rely on TUI screenshots alone when the question is about request payloads, auth headers, or wire-level behavior.

What finally worked for payload verification

The critical correct pathways that proved reliable were:

  1. Use a non-interactive / exec mode, not the TUI, when verifying payloads

    • Interactive TUIs are slower and much harder to analyze.
    • Use whatever your program has for scripting (--output-format, --json, --headless, --batch).
  2. Treat outbound and inbound as separate evidence sources

    • HTTP Toolkit gives outbound HTTP requests.
    • The program's session log gives inbound assistant/tool/application behavior.
    • You need both to answer: "what did the remote return?" and "what did the program actually do with it?"
  3. 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.
    • See the "Runtime proxy matrix" below.
  4. Disable TLS verification only for controlled local debugging when needed

    • If the HTTP Toolkit CA is not trusted locally, use the runtime-specific escape hatch to skip verification.
    • Prefer trusting the CA in your OS / language trust store instead.
    • Never disable TLS in production repros.
  5. Keep runs bounded

    • Long network-heavy sessions can take time.
    • If you only need to prove request shape, export after the relevant request is observed โ€” you do not always need to wait for full completion.

Key Facts

  • Proxy env vars are runtime-specific โ€” know which ones your runtime honors
  • HTTP Toolkit admin API is request-oriented โ€” outbound HTTP comes from HTTP Toolkit, inbound behavior comes from the program log
  • TLS is verified by default โ€” runtime-specific skip flags are local-dev escape hatches only

Runtime proxy matrix

RuntimeProxy env vars / flagsTLS bypass (local dev only)
Node.jsHTTP_PROXY, HTTPS_PROXY, NO_PROXY (most libraries); some HTTP clients need --proxy flags or explicit agent: optionNODE_TLS_REJECT_UNAUTHORIZED=0 or NODE_EXTRA_CA_CERTS=/path/to/ca.pem
BunBUN_CONFIG_PROXY (mandatory โ€” plain HTTP_PROXY/HTTPS_PROXY are silently ignored for Bun's own fetch)NODE_TLS_REJECT_UNAUTHORIZED=0
DenoHTTP_PROXY, HTTPS_PROXY--unsafely-ignore-certificate-errors
Python (requests, httpx)HTTP_PROXY, HTTPS_PROXY, ALL_PROXYREQUESTS_CA_BUNDLE / SSL_CERT_FILE pointing at the HTTP Toolkit CA, or verify=False in code
Python (urllib)Same env varsSSL_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
RubyHTTP_PROXY, HTTPS_PROXYSSL_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 JVMImport CA into a truststore and pass -Djavax.net.ssl.trustStore=...
.NET / C#HTTP_PROXY, HTTPS_PROXY, ALL_PROXY (on recent runtimes) or configure HttpClient explicitlyTrust 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_PROXYdanger_accept_invalid_certs(true) on the client
curl / shellHTTP_PROXY, HTTPS_PROXY env vars or -x/--proxy flag-k / --insecure
Docker containersPass env vars through with -e HTTP_PROXY=...; use host.docker.internal (Mac/Win) or --network=host (Linux) so the container can reach the proxyMount 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.

TLS Safety Guardrails

  • Keep TLS verification enabled whenever possible.
  • Prefer trusting the HTTP Toolkit CA in your local trust store instead of disabling verification.
  • Use runtime-specific TLS-bypass flags only for controlled local debugging in development.
  • Never disable TLS when intercepting production traffic.

Inspecting Captured Logs

Filter to relevant events only

If your program emits newline-delimited JSON, use jq:

jq -c 'select(.type == "tool_call" or .type == "message")' /tmp/session-stdout.log

Adjust the filter to match your program's event schema. For plain-text logs, use rg/grep patterns.

Match outbound HTTP to inbound events

Sort both streams by timestamp, then interleave them. The sequence usually looks like:

outbound 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)

If a program log shows an outbound request that HTTP Toolkit didn't capture, that's a proxy-config bug.