Skip to main content
Breakpoints let you pause a request or response mid-flight, inspect it, and optionally modify it before it continues. You trigger breakpoints from scripts using ctx.breakpoint().

Set a breakpoint in a script

Call ctx.breakpoint() inside an onRequest or onResponse hook. When the matching request fires, httpmon pauses the flow and waits for you to resume it.
// ---
// name: Inspect POST Requests
// match:
//   - "*://httpbin.org/post"
// enabled: true
// ---

function onRequest(ctx) {
  ctx.breakpoint();
}
This script pauses every POST request to httpbin.org/post before it reaches the server.

The breakpoint editor

When a flow hits a breakpoint, it shows a breakpoint state indicator in the flow list. Press Enter to open the breakpoint editor. The editor uses a dual-pane layout:
  • Left pane — Headers. View and edit request or response headers.
  • Right pane — Body. View and edit the request or response body with syntax highlighting.
Modify any header or body content, then press Resume to send the modified request upstream (or the modified response back to the client).
httpmon breakpoint editor

When to use breakpoints

  • Inspect the exact payload your app sends before it leaves
  • Inject or modify headers (auth tokens, content types) on the fly
  • Alter request bodies to test edge cases without changing application code
  • Inspect and rewrite responses before your app processes them