Map Route / Forward
**Forward rules** (Map Route) send requests for a given domain to another machine or port—like Charles Map Remote. The phone and page still use the original domain; DevPeek connects elsewhere behind the scenes. Capture, Mock, and page debugging all honor the same rules.
When to use it
Common scenarios:
- **Forward rules**: point a production API to localhost or staging (client URL unchanged).
- **Param transform**: decrypt encrypted params for reading and Mock.
- **Mock**: temporarily change request or response content.
Combine all three—**no phone hosts file or in-page API base URL change**.
What it does and does not do
Each rule is “match domain → target address”. On hit DevPeek only changes **which server actually receives the request**, not:
- The URL or Host header the browser/app sends (still the original domain).
- The **original** URL/host shown in the capture list and detail panes.
- Bodies themselves (unless Mock or param transform handles them later).
When it applies
Traffic must go through DevPeek. After you save, **new requests** match by domain; put specific rules above broad ones (first match wins).
A common pattern maps a production HTTPS hostname to a local HTTP server, e.g. `api.example.com` → `http://localhost:3300`. The client still uses HTTPS; DevPeek must decrypt that hostname first (root CA trusted on the device, host in the SSL allowlist), then connect to the local port over plain HTTP. Local dev servers usually speak HTTP only—write the target with an `http://` prefix.
Rule syntax
Rules are plain text, one per line:
- Format: `host pattern` + **tab or space** + `target host[:port]` or `http(s)://host[:port]`.
- Lines starting with `#` are comments; disabling a row in the sidebar adds `#` at the front—saved immediately.
- Patterns support wildcards like the SSL allowlist (`*.example.com`, keywords); **first match wins** top to bottom.
- If the port is omitted, HTTPS clients default to 443 and HTTP to 80; dev ports like `3300` need `host:port` or a full URL. When pointing at a local HTTP-only service, use `http://localhost:3300`—do not omit the scheme.
Example
# Forward rules
# Each line: match pattern → target host[:port]; lines starting with # are comments
#
api.example.com 127.0.0.1:8080
*.staging.example.com localhost:3000
h5.example.com http://localhost:3300Configure and manage
Entry 1: title bar Rules → **Forward rules** (standalone window, can sit beside Capture).
- Entry 2: Capture left rail **Forward** panel—toggle rows, add/edit (synced with plain text).
- Entry 3: list or detail context menu **Forward to…**—prefills the request Host and highlights the matching line.
- Capture **Overview** shows **Forwarded URL** when a session hit a rule; click to open the editor on that line.
- Rules export/import with app config; saves apply to new connections immediately.
Sidebar and text editor share one config—use either.
**Rules → Forward rules** plain-text window: one domain mapping per line; can sit beside the capture list.

In capture
Rows still show the client’s original host/URL for filtering and search. When forwarded, **Overview** adds **Forwarded URL** (full upstream URL including path) so you can see where the request actually went.
Mock still matches URLs you see in capture. If Mock or Debug API should hit the forwarded service, confirm the forward target is correct.
Filters, response search, and resend all work on forwarded sessions—see Capture UI & requests.
For page debugging
Mobile web debugging shares the same proxy. Typical flows:
- Phone H5 still calls `https://api.example.com`; Map Route sends that Host to `http://127.0.0.1:8080` without editing the page.
- The Debug tab mirrors pages loaded through the proxy; the network panel and capture list show the same forwarded hops.
- Combine with Mock: Map Route to a local stub, then Mock specific paths—no public deploy needed.
Proxy, certificate trust, and SSL scope still required first—see Mobile web debugging.
Combine with other features
Typical joint-debug flow: set up forwarding (point to localhost) → add param transform if needed (read plaintext) → enable Mock if needed (fake responses). If the target is wrong, check **Forwarded URL** in Overview.
HTTPS, SSL decrypt, and local HTTP
For client HTTPS, DevPeek decrypts first (host must be in the SSL allowlist), then applies forward rules. When pointing at a local HTTP service, use an `http://` target.
If nothing answers after forward: verify the local listener, firewall, and that the **phone** trusts the DevPeek CA—not only the PC.
Limits
- Affects **new requests** after you save; refresh the page or restart the app if an open session still hits the old target.
- First match only—order matters; put specific patterns above broad ones.
- Host-level only (no path routing); paths pass through unchanged to the upstream you mapped to.
Troubleshooting
- Rule ignored: saved? pattern matches Host? line commented with `#`?
- Still hits production: earlier rule matched? clear connections and retry.
- HTTPS page to local HTTP fails: use `http://` target; check SSL allowlist and certs.
- No Forwarded URL in Overview: no enabled rule hit, or target equals original host:port.
Map Route steers production hostnames to your machine or staging—use only with authorization; do not point third-party domains at untrusted services.