Using ngrok’s HTTP Inspector and Request Replay for Local Service Debugging
Discover how ngrok’s built‑in HTTP inspector records every request and how the paid request‑replay feature lets you resend traffic to test or debug local services. The article covers setup, practical examples, limits, and common pitfalls.
15 Mar 2026, 22:42 UTC

Why ngrok’s HTTP Inspector Matters
The core value of ngrok for developers is the ability to expose a local HTTP service to the internet quickly. Beyond that, the built‑in HTTP inspector gives instant visibility into every request that hits your tunnel. For teams that need to debug edge cases, test webhook integrations, or verify request payloads, the inspector is a single‑stop tool that eliminates the need for external packet sniffers or proxy setups.
Key Takeaway
Start an ngrok HTTP tunnel, open the inspector at http://127.0.0.1:4040, and you can view full request/response details and, if you’re on a paid plan, replay the same request to a different endpoint.
Getting the Inspector Working – A Worked Example
Below is a minimal, repeatable workflow that you can copy‑paste into your terminal. It assumes you already have ngrok installed and an account set up.
# 1. Start a local HTTP server on port 8080 (e.g., a simple Python HTTP server)
python -m http.server 8080
# 2. In a new terminal, launch ngrok on the same port
ngrok http 8080
# 3. ngrok will output a public URL (e.g., https://abcd1234.ngrok.io) and the local UI address
# Open the inspector UI in your browser
open http://127.0.0.1:4040
Once the UI loads, you’ll see a Requests tab. Each time your local service receives an HTTP request, a new row appears. Click the row to drill into:
- Request headers – shows method, path, query string, and all incoming headers.
- Response headers – what your local service returned.
- Body – raw request and response payloads.
- Timing – timestamps for when the request entered the tunnel, reached your server, and left.
On a paid plan, the inspector also offers a Replay button. Clicking it opens a modal where you can change the target URL; by default it re‑sends the same request to the original destination. To test a different endpoint, paste https://example.com/api and hit Replay. The modal shows the new response status and body, giving you instant feedback.
Verifying That Replay Is Enabled
- Navigate to the ngrok dashboard (https://dashboard.ngrok.com).
- Under the Plans section, confirm you’re on a plan that lists Request Replay as available.
- In the inspector UI, if the Replay button is grayed out, you’re on the free tier and replay is unavailable.
Limitations & Common Mistakes
Only HTTP(S) Tunnels Are Inspectable
The inspector is protocol‑specific. If you start a TCP or TLS‑only tunnel, ngrok will not record or display any traffic. The UI will show a blank Requests list even though traffic is flowing.
Request History Is Volatile
ngrok stores request data only for the current session. Restarting the tunnel clears all records. If you need persistent logs, export the data manually or integrate a separate logging solution.
Replay Can Alter Server State
Re‑sending a POST or PUT request to a production endpoint could create duplicate records or trigger side effects. Always replay to a staging or mock server unless you’re certain it’s safe.
High‑Volume Traffic Can Slow the UI
When a tunnel receives thousands of requests per minute, the inspector may lag or become unresponsive. Use the filter box in the UI to narrow down by method, status code, or search string, or temporarily stop the tunnel.
WebSocket & HTTP/2 Requests May Appear Fragmented
The inspector is optimized for standard HTTP/1.1 traffic. WebSocket upgrades or HTTP/2 multiplexed streams can be split across multiple rows, making it harder to reconstruct the full conversation.
Practical Checklist Before Using Replay
- Confirm you’re on a paid plan that includes request replay.
- Verify the target URL is a safe, isolated environment.
- Use the UI’s search and filter to locate the exact request you want to replay.
- After replay, review the response in the modal to ensure expected behavior.
- Restart ngrok to clear the inspector history if you’re done.
When to Prefer the Inspector Over External Tools
If you need quick, real‑time visibility into HTTP traffic without installing additional software, the inspector is ideal. It’s also convenient when working with webhooks from third‑party services that send data to your local server; you can immediately see the payload and verify that your endpoint is parsing it correctly.
For more advanced traffic manipulation, persistent logging, or non‑HTTP protocols, consider supplementing ngrok with tools like mitmproxy or a dedicated reverse proxy.
Conclusion
ngrok’s HTTP inspector and request‑replay feature provide a powerful, low‑overhead way to debug and test local HTTP services. By following the steps above and being aware of the feature’s constraints, you can make informed engineering decisions about when to rely on ngrok alone or when to augment it with additional tooling.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.