Map Remote

Send matching requests to a different scheme, host, port or path, without rebuilding the app.

Mac iPhone and iPad Android

Map Remote sends a request somewhere else on its way out. Your app still sees the URL it asked for. WireLens sends the request to the destination you chose and hands the answer back, with no redirect involved. It is the fastest way to point a build at staging, at a local server, or at a colleague's branch.

Add a rule#

  • Mac: select a flow and choose Flow ▸ Create Rule ▸ Map Remote…, or right-click it and choose Create Rule ▸ Map Remote…. To start empty, open Tools ▸ Map Remote and click Add Redirect.
  • iPhone and iPad: open Tools ▸ Map Remote and add a rule.
  • Android: long-press a host or a request and choose Map Remote…, or open Tools ▸ Map Remote and tap New rule.

A rule has a pattern to match and a destination:

FieldExample
Fromhttps://api.example.com/*
Tohttps://staging.example.com

How much of the original URL survives depends on the platform:

PlatformWhat the destination replaces
Mac, Whole URLEverything. A destination with no path sends every matching request to /.
Mac, ComponentsOnly the parts you fill in. Blank parts keep what the request had.
iPhone and iPadEverything: the request goes to the To URL as written.
AndroidA host alone keeps each request's path and query. A URL with a path replaces the path.

To move a whole API to another host and keep every path, use Components on the Mac and fill in only Host. On iPhone, a Rewrite rule that changes only the host does the same. On Android, give a host with no path.

The Host header follows the new address#

When a rule sends a request to another hostname, WireLens updates the Host header to match. On the Mac and iPhone it also uses the new name during the TLS handshake. Shared hosts and CDNs then answer for the name they actually serve.

  • On the Mac and iPhone, when the destination is an IP address, WireLens keeps the original hostname, because many servers refuse a request whose Host is a bare address.
  • Preserve Host on the Mac, and Keep the original Host header on Android, keep the original hostname for any rule, for a server that routes on the name your app asked for.

HTTPS hosts#

For HTTPS, the original host has to be decrypted so WireLens can read the request and send it on. See SSL Proxying. The new destination gets an ordinary secure connection from WireLens.

On the Mac#

Traffic
Rules
Setup
Map Remote
Send matching requests to a different URL.
Rules
2 rules · 1 armedExpand AllEnable AllDisable All
Staginghttps://api.acme.dev/*→ https://staging.acme.dev
From
https://api.acme.dev/*
Destination
Whole URLComponents
To
https://staging.acme.devSplit into ComponentsReplaces the path too. Use Components to keep it.
Preserve Host
Keep the original Host header.
Conditionsany request
Highlight
Folder
Staging
Test this rule
Fired 208× · 1s ago·https://api.acme.dev/v2/cart/items
wss://live.acme.dev/*→ ws://localhost:8080
Add Redirect
Clients still see the original URL. WebSocket upgrades are redirected too.
Folders
Staging
Folder nameTop levelAdd Folder
Tools ▸ Map Remote

Destination switches between Whole URL and Components:

  • Whole URL takes one URL in To. Split into Components copies it into the component fields.
  • Components has Protocol, Host, Port, Path and Query, each blank by default to keep the original. In Query, a hyphen (-) removes the query.

Each rule can be narrowed under Conditions by method, GraphQL operation or a request header, sorted into folders, and checked against sample URLs with Test this rule. WebSocket upgrades are redirected too: write the pattern as ws:// or wss://, or keep an http/https pattern, which matches the socket on that host.

On iPhone and iPad#

A rule has From (URL pattern) and To (absolute URL), which needs a scheme and a host, such as https://staging.example.com/. Conditions narrows it by method and request header, and Note says what the rule is for.

On Android#

The host menu with Map Remote…
Long-press a host

The editor has Match (pick a captured request or type a pattern, then Methods) and Send to, where Server takes a host or a URL. For example shows a captured URL next to the URL it would be sent to. Keep the original Host header sends the new server the Host the app asked for. Test a URL on the list shows which rule would act on a URL you type.

Free and Pro#

The free plan includes one Map Remote rule on every platform. Pro removes the limit.

Command line and MCP#

The command line and the MCP server run on the Mac. wirelens ships inside the app and is not on your PATH until you link it once.

bash
wirelens rules map-remote \
  --from 'https://api.example.com/v2/config' \
  --to 'https://staging.example.com/v2/config'

--to is a whole URL, as in the app's Whole URL mode. The MCP tool is add_map_remote, which also takes preserve_host and conditions.

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