ctx.respondWith({file}).
Quick add via TUI
Press S to open the scripts manager, then m to add a Map Local rule. Enter a URL pattern and a local file path — httpmon generates a script that serves the file for matching requests.| Key | Action |
|---|---|
S | Open scripts manager |
m | Add a new Map Local rule |
Tab | Switch between pattern and path fields |
Enter | Save the rule |
Esc | Cancel |
Via scripts
Usectx.respondWith with the file option in an onRequest hook.
file path is relative to the script directory (~/.httpmon/scripts/). The content type is auto-detected from the file extension.
You can also return inline content:
How it works
When a request matches a map local script, httpmon returns the local file’s content directly to the client without contacting the upstream server. Thectx.respondWith() call in onRequest halts script execution immediately and sends the synthetic response.
Scripts that use ctx.respondWith() are tagged with a Map Local badge in the scripts manager so you can tell them apart from regular scripts.
