Skip to main content
The recording proxy captures HTTP requests and responses flowing through it, then exports them as .http files. It is a fast way to bootstrap tests from existing API traffic.

How It Works

  1. Start the proxy pointing at your target server
  2. Send requests through the proxy (manually or from your app)
  3. Stop the proxy (Ctrl+C)
  4. hitspec exports all captured traffic as a .http file

Quick Start

Flags

Examples

Network Access

The proxy listens on 127.0.0.1 and forwards to whatever --target says, so it is not reachable from the network unless you ask: --host 0.0.0.0 binds all interfaces. If the port is already in use, hitspec record exits 3.

What Gets Recorded

The proxy captures:
  • HTTP method and full URL, including a path prefix from --target (--target https://api.example.com/v2 records https://api.example.com/v2/users)
  • Request headers
  • Request body
  • Response status code, headers and body
Responses are streamed to your client as they arrive, so server-sent events and chunked responses work through the proxy. The recording keeps up to 1 MiB of each body and is stored when the response ends (or the client disconnects).

What Gets Redacted

Unless you pass --no-redact, the proxy replaces secrets with {{PLACEHOLDER}} references:
  • Headers: Authorization, Proxy-Authorization, Cookie, Set-Cookie, X-Api-Key and Api-Key (for example {{AUTHORIZATION}})
  • JSON fields named password, secret, token or apiKey in request and response bodies, including names that end in one of those such as access_token or clientSecret (the value becomes "{{ACCESS_TOKEN}}")
Define those variables in your environment to replay the recording. Other bodies, such as form data, are recorded as they are.

Output Format

The exported .http file follows standard hitspec format:
After recording, edit the generated file to add meaningful assertions, replace hardcoded values with variables, and add @depends directives for request ordering.
Last modified on October 19, 2026