NetPeek User Manual

NetPeek is a local network capture & debugging tool. All traffic analysis happens on-device — nothing is uploaded. This manual is organized by core feature; tap a chip to jump, and the blue buttons open the matching feature directly.

① Capture ② Decrypt HTTPS ③ Rewrite rules ④ Expert syntax ⑤ Scripts ⑥ Replay ⑦ Constants ⑧ Filters ⑨ MITM hosts ⑩ Toolbox ⑪ MCP service ⑫ Sharing ⑬ Privacy & safety

1Capture

Capture is where everything starts: once on, the app takes over traffic through a local VPN tunnel and records every request/response for you to inspect.

  1. On the home screen tap the big Start Capture button; the first time, allow the VPN configuration.
  2. Use your other apps normally — requests appear live in the Recent Requests list.
  3. Tap any row for Request Detail: URL, request/response headers, body, status code, timing and TLS info.
  4. Tap the big button again to Stop Capture.

Swipe a row for shortcuts: copy as cURL, add filter, add MITM, New rewrite from this request, export HAR, favorite, delete.

Plain HTTP is readable as-is; HTTPS must be decrypted first (next section), otherwise you only see the host and encrypted bytes.

2Decrypt HTTPS (install the certificate)

To read HTTPS content you must install and trust the CA certificate NetPeek generates on-device. You do this manually — iOS forces the step through Settings.

  1. After starting capture, open the certificate page at http://127.0.0.1:8080 in a browser and download the profile.
  2. Go to Settings → General → VPN & Device Management and install the profile.
  3. Then Settings → General → About → Certificate Trust Settings and enable full trust for the NetPeek certificate.
  4. Add the domains you want to decrypt to the MITM host list (section 9).
The certificate is only for on-device debugging and is never uploaded. Upstream certificate verification is fail-open by default (it won't break connectivity on cert issues), so you can debug misconfigured servers.

3Rewrite rules (Simple mode)

Rewriting changes traffic without changing code: add headers, replace response fields, mock APIs, block ads, redirect. A rule = a condition (when it applies) + an action (what to do). Beginners use Simple mode — a few taps.

  1. Swipe a row in Recent Requests → "New rewrite" (host/path prefilled), or tap + in the rewrite list.
  2. When it applies: pick "All requests" or add conditions (host contains / path begins with …).
  3. What to do: pick one of six intent cards.
  4. Set the details: fill fields per intent. A plain-language summary updates live; confirm and tap Save & Enable.
IntentUse
Edit HeaderAdd / change / delete a request or response header
Edit BodyReplace a piece of text in the response/request body
Mock responseSkip the real request and return custom content
Block requestReturn empty response / JSON / image — great for ad & tracker blocking
RedirectSend the request to another URL (e.g. prod → staging)
Local fileServe a file on the device as the response
New rewrite Open rewrite list
Multiple conditions are combined with AND. For OR, create another rule with the same action. For richer combos (multiple actions, parentheses, regex), tap Expert mode at the top-right of the editor.

4Rewrite rules · Expert syntax (DSL)

Expert mode lets you write the rule statement directly for full power. The first symbol of an action (^ replace, ~ delete, or an @ whole-request verb) decides what; the following @req.*/@rsp.* decides where; quotes hold the value.

Always use straight ASCII quotes "; curly quotes silently break a rule.

Condition objects

ObjectMeaningExample
@req.hostRequest host@req.host CONTAINS "example.com"
@req.apiPath@req.api BEGINSWITH "/api/v1"
@req.urlFull URL@req.url MATCHES ".*\.jpg(\?.*)?$"
@req.queryQuery string@req.query CONTAINS "debug=1"
@req.methodHTTP method@req.method == "POST"
@req.port / @req.schemaPort / scheme@req.schema == "http"
@req.header["Name"]Request header@req.header["Content-Type"] CONTAINS "json"
@req.bodyTextRequest body@req.bodyText CONTAINS "vip"
@rsp.header["Name"]Response header@rsp.header["Content-Type"] CONTAINS "json"
@rsp.bodyTextResponse body@rsp.bodyText CONTAINS "false"
@rsp.status / @rsp.statusLineStatus code / line@rsp.status == "404"

Comparison & logic

Compare: == != > < >= <= CONTAINS BEGINSWITH ENDSWITH LIKE (wildcards */?) MATCHES (regex, whole match) IN ANY/ALL/NONE. Logic: && (AND) || (OR) ! (NOT), group with ().

Actions

ActionMeaningExample
^Replace / insert^@req.header["X-Debug"] "1"
~Delete~@req.header["Authorization"]
@mockReturn a custom response@mock "{\"ok\":true}"
@reject*Empty content (empty / image / object / array)@reject-array
@redirectRedirect (or @301@308)@redirect 307 "https://test/x"
@map-localServe a local file@map-local "/shared/mock.json"
@breakBreak the request@break

ExampleAdd a debug header and flip a response field to true

Cond:  @req.host CONTAINS "api.example.com" && @req.api BEGINSWITH "/feature"
Act 1: ^@req.header["X-Debug"] "1"
Act 2: ^@rsp.bodyText "\"enabled\":false" "\"enabled\":true"

5Scripts

When rules aren't enough, use JavaScript to handle matched requests more flexibly: read/rewrite request & response, gunzip bodies, compute values conditionally. Scripts are scoped by host and run in the tunnel, like rules.

  1. Tap + in the script list, set a name and scope (host).
  2. Write your logic in the editor (helpers like $utils provide gzip/gunzip etc.).
  3. Save & enable, then re-send the request to see the effect.
Open scripts New script

6Replay

Save a captured request, tweak parameters and send it again — handy for API iteration and reproducing issues. One-tap create from Request Detail.

  1. Choose "Add to Replay" from the detail/swipe menu, or tap + in the replay list.
  2. Edit method, URL, headers, body; optionally schedule or loop.
  3. Send and inspect the response; past results are kept.
Open replays New replay

7Constants

Store frequently-used values (a mock JSON, a token, a test URL) as constants and reference them in rules with ${constantId} — change one place, update everywhere.

Open constants New constant
Simple-mode Mock already assembles the response for you, so you rarely need a constant by hand; constants shine when reused across several expert-mode rules.

8Filters (see only what matters)

The capture list gets long. Filters cut the noise:

9MITM host list

For performance and stability, NetPeek only decrypts (MITM) the domains you specify; the rest pass through transparently. The list supports wildcards:

The app's own backend (control-plane) domain is always forced direct, never decrypted, and never written to the capture database — a safety red line.

10Toolbox

Open Settings → Toolbox for encoding, hashing, encryption helpers, timestamps, UUIDs, JSON formatting, and more. Use the regex tool to validate match patterns before you write rewrite rules.

11MCP service

To let a desktop AI client help analyze captures on this phone, turn on NetPeek MCP. Find it under Settings → NetPeek MCP (off by default).

  1. Enable the service and copy the access token.
  2. On a computer on the same network (or over USB), enter the service address and token in your AI client.
  3. Once connected, you can browse captures, inspect requests, and import rules when needed.
Don’t share the token with untrusted people, and avoid leaving the service on untrusted networks. Turn it off or revoke the token when you’re done.

12Sharing & importing rules

Share rewrite rules with teammates, or import rules someone sent you. Sign in before sharing or importing.

Share rules

  1. Open Rewrite Rules, select the rules, then choose Share.
  2. Enter a title, set how many times it can be imported, and how many days it stays valid.
  3. Confirm, then copy the share command (or use the system share sheet) and send it.
If the selection includes private rules, you’ll be asked to confirm: recipients can use those rules, but can’t view, edit, re-share, or export their contents.

Import rules

  1. Copy the share command or link you received.
  2. Open NetPeek — if a share is detected on the clipboard, you’ll be prompted to review and import it.
  3. Or open Rewrite Rules → Import Share Code, paste the code, review, then redeem.
Review shows only basic info such as title, publisher, and counts. Rule content downloads after you confirm. You can’t import a share you created yourself.

Manage & update

13Privacy & safety

To verify a rewrite: save and enable it, send the request again, then check the latest request detail — don’t rely only on older captures.