Skip to content

How Wiretap works

Wiretap joins two traffic paths in one local history.

command in child shell
│
▼
local MITM proxy ── transforms ──► destination server
│ │
└──── request + response ◄─────┘
│
▼
local SQLite

wiretap intercept start opens a child shell whose supported HTTP clients use Wiretap’s loopback proxy and local certificate authority.

Two senders — a third-party webhook provider and a direct HTTP POST to a project path — reach wiretap-relay, which stores each delivery once and fans it out over outbound WSS tunnels to two clients. Client A is offline and catches up on reconnect; every client keeps its own local database.

The relay stores each delivery once and fans it out to every subscribed desktop. An offline client simply catches up when its tunnel reconnects.

Webhook traffic reaches the public HTTPS endpoint of your hosted wiretap-relay deployment. The relay stores each webhook once and forwards it to every client subscribed to the project. Each subscriber advances an independent acknowledgement cursor and catches up after reconnecting. Because every desktop initiates its own WSS tunnel, no inbound desktop port is exposed to the internet.

  • Intercepted traffic, received webhooks, and transforms live in the desktop’s local SQLite database.
  • Queued webhook bodies, projects, subscriptions, delivery cursors, and client registrations live in the relay’s SQLite database.
  • Relay client tokens prefer the operating-system credential store and fall back to a credentials file that only your user account can read (mode 0600). Relay-admin tokens are never written to disk as plaintext; a saved admin profile requires the operating-system keyring.

Transforms run in a local, sandboxed JavaScript runtime:

  • on_request before an intercepted request goes upstream;
  • on_response before the response returns to the intercepted client;
  • on_webhook before a delivered webhook is stored locally;
  • on_replay before a webhook or composed request is sent;
  • on_compose only when selected to prepare a request draft.

Transforms have no filesystem or network API. See the Transform API for the exact data model and helpers.