Skip to content

How It Works

Understanding how Inspectr operates helps you get the most out of its features. This page breaks down the high-level flow of how requests are captured, analyzed, and displayed in real time.


Inspectr sits between your client (frontend, curl, API tool) and your backend or external service. It captures every request and response, adds visibility, and optionally mocks or exposes the traffic externally.

You can think of it as:


You launch Inspectr with CLI flags or a .inspectr.yaml config:

Terminal window
inspectr --listen=:8080 --backend=http://localhost:3000

Inspectr listens for incoming HTTP requests on the configured port (default :8080).

When a request is received, Inspectr:

  • Parses headers, query params, path, and body
  • Creates an internal operation object to store metadata

Inspectr decides what to do with the request:

  • Forward to backend if --backend is defined
  • Mock a response if --mock-backend is defined
  • Catch it if --catch is true (default when no backend is set)

Inspectr returns the appropriate response to the client:

  • Backend response
  • Mocked OpenAPI response
  • Default 200 OK (catch mode)

The request and response are:

  • Stored in-memory or SQLite (for later search/replay)
  • Sent as an SSE (Server-Sent Event) to the Inspectr App

In the browser, the Inspectr App (default http://localhost:4004) shows:

  • Live request logs
  • Headers, bodies, status codes
  • Replay options and override flags

  • Ingress Mode: Expose your proxy via in-spectr.dev
  • Response Overrides: Use headers to simulate delays, errors, or switch examples
  • Mock Mode: Use OpenAPI specs to respond even if your backend is unavailable
  • Catch Mode: Catch and view any incoming requests without forwarding

Inspectr captures traffic in real time, whether you’re testing integrations, debugging webhooks, or mocking APIs. It gives full visibility into what’s happening between client and backend.