Map Local

Answer matching requests with a status, headers and body from your device. The origin is never contacted.

Mac iPhone and iPad

Map Local answers a request itself. When a URL matches a rule, WireLens returns the status, headers and body you gave it, and the request never leaves your device. Use it to build against an endpoint that does not exist yet, to reproduce an edge case the server rarely returns, or to keep working while a backend is down.

Create a rule#

Open Tools ▸ Map Local and add a rule, or select a captured flow and choose Create Map Local Rule…, which starts from that response.

FieldNotes
URL patternWildcards or a regular expression. A blank pattern is refused.
StatusAny HTTP status, 200 by default.
HeadersSent as written. Set Content-Type so the app parses the body the way you expect.
BodyTyped in place, or loaded from a fixture file.
HTTP message fileOptional. A complete response, status line and headers included, from a file; its body can come from another file.
ScopeOptional. Narrow the rule by method, status, content type, a header or a GraphQL operation name.
DelayOptional. Waits before answering, to simulate a slow endpoint.
Also pauseOptional. Stops at a breakpoint first, so you can edit the mocked response before it is returned.

How it shows up in Capture#

Mapped flows are marked as Map Local in the traffic list and the inspector, so a mock can never pass for a real server response in a screenshot or an exported HAR. A flow's Summary lists every rule that changed it.

WireLens warns you in the editor when a mapped file has gone missing, and Test this rule checks the pattern against sample URLs before you save.

HTTPS hosts#

For an HTTPS URL, the host has to be decrypted: WireLens can only answer a request it can read. A rule aimed at a host that is not on the SSL Proxying Include list says so in the Tools pane. Add the host from SSL Proxying.

Map Local, Rewrite or Scripting?#

  • Map Local replaces the whole response and skips the server.
  • Rewrite changes part of a real response on its way through.
  • Scripting decides in code, per request, and can call mock() to answer locally too.

Free and Pro#

The free plan includes one Map Local rule. Pro removes the limit.

From the command line#

bash
wirelens rules map-local \
  --pattern 'https://api.example.com/v2/catalog*' \
  --status-code 200 \
  --content '{"items":[],"page":{"next":null}}'

The MCP tool is add_map_local. After adding a rule, send the request through the proxy (send_request or replay_flow) and look for the mapped flow with list_flows.

Something here is unclear, or wrong for your setup? Contact support or write to support@wirelens.app.