| title | ngrok Agent Web Inspection Interface |
|---|---|
| sidebarTitle | Observe Agent Traffic |
| description | Learn how to use the ngrok agent's web inspection interface at localhost:4040 to view HTTP requests and responses in real-time. |
The ngrok agent ships with a realtime inspection interface which allows you to see what traffic is sent to your upstream service and what responses it is returning.
The Web Inspection Interface is only available in the ngrok standalone agent and not in the ngrok Agent SDKs. If you are interested in viewing traffic across all endpoints, longer retention periods, or sharing traffic events with other teammates, check out the Traffic Inspector in the ngrok Dashboard instead.
Every HTTP request through your endpoints will be displayed in the inspection interface. After you start the ngrok agent, open http://localhost:4040 in a browser on the same machine. You will 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. Furthermore, ngrok does not display provisional 100 responses from a server.
Inspection is only supported for HTTP endpoints. TCP and TLS endpoints do not support any inspection and will not show up in the inspection interface.
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.
Your upstream service may receive many requests, but you are often only interested in inspecting 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.
You may specify multiple filters. If you do, requests will only be shown if they much all filters.
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 the Replay button at the top-right corner of any request on 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 will not be subject to any policies that exist on your Cloud Endpoint since those are applied prior to the request reaching the local agent. If you are interested in replaying the original request before the endpoint policies are applied and testing new policies, please use the Traffic Inspector in the ngrok Dashboard.
Sometimes you want to modify a request before you replay it to test a new behavior in your upstream service.
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'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.
The status page also display metrics about the traffic through each endpoint. It display connection rates and connection duration percentiles for all endpoints. For HTTP endpoints, it also displays http request rates and http response duration percentiles.








