Skip to content
Browse the docs
guides

Request Inspector

Inspect and replay every request through your tunnel, in a local web UI

Overview

The terminal log tells you a request happened. The inspector tells you what was in it.

Every tunnel runs a small web UI on your own machine listing the requests that passed through it (full headers, full bodies, both directions), with a Replay button that sends any of them to your local app again. No dashboard, no account lookup, no round trip to our servers.

It is on by default. The tunnel banner prints the address it bound:

Tunnel Status: online
Forwarding: https://a7f9x2--acme-shop.zgrok.io → http://localhost:3000
Requests: https://zgrok.io/dashboard/tunnels/clx8k2n40/logs
Inspect: http://127.0.0.1:4040

Open that URL in a browser and leave it alongside your terminal.

It never leaves your machine. The inspector binds 127.0.0.1 only, and it answers only to a loopback Host header, so it is not reachable from another device on your network. A web page you visit cannot read it, cannot trigger a replay, and cannot show it in a frame (why loopback alone does not stop those). Captured bodies routinely contain Authorization headers, cookies and webhook signing secrets; keeping them local is the point.

What you see

The zgrok inspector: a list of six requests on the left, and on the right a POST to /webhooks/payments with its request headers, including a Stripe-Signature, and its JSON body, beside a Replay button.
A payment webhook opened in the inspector, with its signature header and body as they arrived.

The left column lists requests newest-first: method, path, status, how long your app took, and whether the request completed. The filter box narrows it by method, path or status as you type. Click a row to open it:

  • Request headers and response headers, verbatim, in the order they were sent
  • Request body and response body: text rendered as text, anything binary shown as base64
  • The status, the wall-clock time your local app took, and the byte count in each direction

The list refreshes on its own as traffic arrives. Nothing needs a reload.

A record appears when the request finishes

Not while it is in flight. For webhooks and ordinary APIs the difference is invisible. For a long streaming response (zgrok ai completions, SSE, application/x-ndjson), it means the inspector shows nothing for that request until the stream ends. That is expected, not a stall.

Replay

Open a request and press Replay. zgrok sends the exact bytes it captured (same method, same path, same headers, same body) straight to your local app on 127.0.0.1. It does not go back out through the tunnel, so the sender never sees it and nothing on the public URL is triggered twice.

The replayed request lands in the list as a new record, marked with the request it came from, so you can compare the two responses side by side.

This is what makes webhook work tolerable: trigger the event once at Stripe or GitHub, then iterate on your handler by replaying that one delivery until it is right.

Some requests cannot be replayed, and the button says which:

RefusalWhy
Protocol upgrade (101)A WebSocket is a long-lived connection, not a request/response pair
Request body was truncatedReplaying it would send a body that disagrees with its own Content-Length
Request body was not capturedThe body was skipped, so there is nothing to send
No complete copy was keptThe request predates the capture, or its bytes were released

Limits

The inspector holds the last 50 requests for the tunnel, in memory only. Restart the tunnel and the list is empty again. Nothing is written to disk unless you ask for it with --log-file.

Bodies are captured up to 128 KB per direction, so a large upload cannot starve the response next to it. Past that the body is cut off and the record says so: a truncated body is labelled as at least N bytes rather than shown as an exact size, so you can always tell "this response was 4 KB" from "this response was cut off at 128 KB".

Across the whole process, captured bodies are capped at 32 MB. Once that is reached, new requests still get a record (method, path, status, timing, byte counts are all still there), but their bodies are marked as skipped rather than stored. You never lose the request; you lose its contents.

Turning it off, or moving it

Disable the inspector for a run:

bash
zgrok http 3000 --no-inspect

Bind a different port, which is useful when 4040 is taken by something you care about:

bash
zgrok http 3000 --inspect-port 4100

If the port is busy, zgrok walks upward (4040, 4041, … up to ten ports) and prints whichever one it actually bound. The banner is the authoritative number; if no port in that range is free, the tunnel starts anyway without an inspector.

Set either permanently in your config:

yaml
# ~/.zgrok/config.yaml
inspect: false        # default: true
inspect_port: 4100    # default: 4040

A flag always beats the config file. --no-inspect and --inspect-port are mutually exclusive: asking for a port and no inspector at once is a mistake worth catching, so the CLI refuses it.

Both flags work on zgrok ai exactly as they do on zgrok http.

JSON export

For piping into another tool, --log-json writes one JSON object per completed request to stdout:

bash
zgrok http 3000 --log-json | jq 'select(.status >= 500)'

Every human-facing line zgrok prints (the banner, the request log, errors) goes to stderr, so this works with no redirection games. --log-file appends the same records to a file instead, and the two can be used together:

bash
zgrok http 3000 --log-json --log-file ./requests.jsonl

Export is independent of the inspector. Either flag turns on capture on its own, so --no-inspect --log-json is a valid and sensible combination: no web UI, no bodies held in memory, just a machine-readable record per request. With neither the inspector nor an export flag, no capture happens at all and the feature costs nothing.

Record format

json
{"ts":"2026-08-13T10:00:00.123456+00:00","id":42,"method":"POST","path":"/webhooks/stripe","status":200,"local_duration_ms":13,"req_bytes":812,"resp_bytes":47,"outcome":"completed","req_truncated":false,"resp_truncated":false,"replay_of":null}
FieldTypeMeaning
tsRFC 3339 stringWhen the request completed
idintegerPer-session record id, the same id the inspector shows
methodstringHTTP method
pathstringRequest path, including the query string
statusinteger or nullResponse status; null when there was no response
local_duration_msintegerHow long your local app took
req_bytes / resp_bytesintegerBytes seen in each direction
outcomestringcompleted, upgraded, local_down, or aborted
req_truncated / resp_truncatedbooleanWhether the byte count above is a lower bound
replay_ofinteger or nullThe id this record was replayed from

outcome is worth watching. local_down means zgrok could not reach your local port at all, and the visitor got a branded 503. aborted means the connection died mid-request. upgraded is a WebSocket or other 101, which has no single response to record.

Bodies are deliberately absent from the export. They carry secrets and would dominate the file. Use the inspector when you need to see a body.

| jq looks like it prints nothing? jq block-buffers when its output is not a terminal, so --log-json | jq > out.json appears silent until the tunnel stops. Add jq --unbuffered and records appear one at a time, live. Nothing is being dropped.

If a sink fails (disk full, or the pipe closes because you ran | head -5), zgrok says so once and stops writing to that sink. The tunnel keeps running, and the other sink is unaffected.

See also