Skip to main content
The ngrok CLI ships with a real-time inspection interface which allows you to see what traffic is sent to your upstream service and what responses it’s returning. The Web Inspection Interface is only available in the ngrok CLI and not in the ngrok SDKs. If you want to view traffic across all endpoints, longer retention periods, or sharing traffic events with other teammates, check out the Traffic Inspector in the ngrok dashboard instead.

Inspecting requests

Every HTTP request through your endpoints appears in the inspection interface. After you start the ngrok agent, open http://localhost:4040 in a browser on the same machine. You can see all of the details of every request and response including the time, duration, source IP, headers, query parameters, request payload, and response body as well as the raw bytes on the wire. The inspection interface has a few limitations. If an entity-body is too long, ngrok may only capture the initial portion of the request body. ngrok also doesn’t display provisional 100 responses from a server. Inspection is only supported for HTTP endpoints. TCP and TLS endpoints don’t support inspection and don’t show up in the inspection interface.
ngrok agent web inspection interface showing HTTP request and response detail with Summary, Headers, Raw, and Binary tabs

Detailed introspection of HTTP requests and responses

Request body validation

ngrok has special support for the most common data interchange formats in use on the web. Any XML or JSON data in request or response bodies is automatically pretty-printed and checked for syntax errors.
ngrok web inspection interface showing a JSON syntax error with the problematic key highlighted in orange

The location of a JSON syntax error is highlighted

Filtering requests

Your upstream service may receive many requests, but you usually only want to inspect some of them. You can filter the requests that ngrok displays to you. You can filter based on the request path, response status code, size of the response body, duration of the request, and the value of any header.
ngrok web inspection interface filter dropdown showing options including Path, ResponseSize, and StatusCode

Click the filter bar for filtering options

You may specify multiple filters. If you do, ngrok only shows requests that match all filters.
ngrok web inspection interface showing filtered requests matching path and status code filters with one result

Filter requests by path and status code

Replaying requests

Developing for webhooks issued by external APIs can often slow down your development cycle by requiring you do some work, like dialing a phone, to trigger the hook request. ngrok allows you to replay any request with a single click, dramatically speeding up your iteration cycle. Click Replay on any request in the web inspection UI to replay it. Replay works via the local agent sending the request directly to your upstream service. As such, the replayed request isn’t subject to any policies that exist on your Cloud Endpoint since those are applied prior to the request reaching the local agent. To replay the original request before the endpoint policies are applied, or to test new policies, use the Traffic Inspector in the ngrok dashboard.
ngrok web inspection interface showing a captured request with the Replay button in the top right corner

Replay any request against your web server with one click

Replaying modified requests

Sometimes you want to modify a request before you replay it to test a new behavior in your upstream service.
ngrok web inspection interface showing the Replay button dropdown with the Replay with Modifications option

Click the dropdown arrow on the 'Replay' button to modify a request before it is replayed

The replay editor allows you to modify every aspect of the HTTP request before replaying it, including the method, path, headers, trailers, and request body.
ngrok web inspection Modify Request dialog showing editable method, path, headers, and body fields

The request replay modification editor

ngrok agent status page

ngrok’s local web interface has a dedicated status page that shows configuration and metrics information about the running ngrok process. You can access it at http://localhost:4040/status. The status page displays the configuration of each running endpoint and any global configuration options that ngrok has parsed from its configuration file.
ngrok agent status page showing Configuration section with tunnel URLs, addresses, and global settings

Endpoint and global configuration

The status page also displays metrics about the traffic through each endpoint. It displays connection rates and connection duration percentiles for all endpoints. For HTTP endpoints, it also displays HTTP request rates and HTTP response duration percentiles.
ngrok agent status page showing Metrics section with connection counts, connection duration percentiles, and HTTP request rates

Endpoint traffic metrics