relay-core — zsh
$ relay-core --version
relay-core 0.14.0

$ relay-core ca generate
CA certificate generated at ~/.relay-core/ca_cert.pem

$ relay-core start
RelayCore daemon started
  Proxy   127.0.0.1:8080
  Control http://127.0.0.1:8082/
  MCP     http://127.0.0.1:18083/mcp
  CA      cert=~/.relay-core/ca_cert.pem key=~/.relay-core/ca_key.pem
▋

RUST-BASED TRAFFIC INTERCEPTION ENGINE

~40x faster than mitmproxy.
MITM proxy for HTTP/HTTPS/WebSocket with full programmatic control.

What RelayCore Does

Full MITM Support

Dynamic TLS certificate generation with automatic CA installation.

WebSocket Interception

Message-level inspection, modification, and replay for WebSocket.

Rule Engine

Match + action pipeline for headers, body, status, redirect, mock.

Scriptable

Deno runtime for dynamic request/response modification.

Interception Breakpoints

Pause live traffic, inspect, modify, then resume or drop.

Prometheus Metrics

Built-in Prometheus text format and JSON metrics endpoint.

MCP for AI Agents

An MCP server exposes flows, rules and metrics as tools and subscribable resources, so an agent can read and drive live traffic.

gRPC and h2c

Plaintext HTTP/2 in both directions — including inside a CONNECT tunnel — with gRPC message framing and trailers recorded.

Architecture

ADAPTER LAYER public crates PUBLIC relay-core-http REST + SSE PUBLIC relay-core-probe MCP · AI PUBLIC relay-core-tauri RelayCraft PUBLIC relay-core-cli CLI · TUI · embedded HTTP INTERNAL relay-core-api Flow · Rule · Policy · Event PUBLIC relay-core-runtime CoreState lifecycle · rule store · event bus · proxy spawn ENGINE internal crates INTERNAL relay-core-lib MITM · HTTP/HTTPS · WebSocket · TLS · rule execution interceptor chain: Script → Rule → Metrics → adapter INTERNAL relay-core-storage SQLite optional persist · flows · audit INTERNAL relay-core-script Deno/V8 (optional) feature "script"
PUBLIC relay-core-runtime State orchestration, lifecycle, rules
PUBLIC relay-core-http REST + SSE adapter
PUBLIC relay-core-probe MCP adapter for AI agents
PUBLIC relay-core-cli CLI · TUI · embedded HTTP API
INTERNAL relay-core-api Flow / Rule shared contracts
INTERNAL relay-core-lib MITM · proxy · rule execution
INTERNAL relay-core-script Deno/V8 scripting (optional)
INTERNAL relay-core-storage SQLite persistence (optional)

Performance

~39K
req/s
Throughput (S1)
~139
ms
Cold Start
~59
MB
Idle RSS
~3.4
ms
P99 Latency Add
Metric RelayCore mitmproxy
Language Rust Python
Throughput ~39K req/s ~2.5K req/s
P99 Latency ~3.4 ms ~150 ms
Cold Start ~139 ms ~1.5 s
Scripting Deno / TypeScript Python addons
Deployment Single static binary Python + dependency tree
Rule config JSON / YAML rules, no restart Addon scripts + restart

Measured on M4 Max / macOS 27 / 64 GB, 1 KB payload. Throughput vs mitmproxy comes from compare_mitmproxy.sh (100 concurrent connections): 38,884 req/s and 3.42 ms P99, versus mitmproxy's 2,517 req/s and 150.44 ms — a 15.45× throughput ratio. Cold start and idle RSS come from the v0.14.0 release baseline (139.2 ms / 58.8 MB). Full methodology and raw data in benchmarks/.

HTTP API

GET http://127.0.0.1:8082/api/v1/flows?limit=10
Response 200 OK
{
  "flows": [
    {
      "id": "fld_01HX5K9P3Q8Y2Z7",
      "method": "GET",
      "path": "/users",
      "status": 200,
      "duration_ms": 42
    }
  ],
  "pagination": {
    "total": 12847,
    "returned": 10,
    "offset": 0
  }
}
GET
/api/v1/flows
Search and paginate flows
GET
/api/v1/flows/:id
Get flow detail
GET
/api/v1/rules
List all rules
PUT
/api/v1/rules
Upsert a rule
DELETE
/api/v1/rules/:id
Delete a rule
POST
/api/v1/intercepts
Create intercept rule
GET
/api/v1/events
SSE stream of live updates
GET
/api/v1/metrics/prometheus
Prometheus format metrics

CLI Reference

$ relay-core run --listen 127.0.0.1:8080
RelayCore proxy started
  Proxy   127.0.0.1:8080
  Control http://127.0.0.1:8082/
  TUI     run with --ui for interactive mode
  CA      cert=~/.relay-core/ca_cert.pem key=~/.relay-core/ca_key.pem
$ relay-core ca generate
CA certificate generated at ~/.relay-core/ca_cert.pem
$ relay-core rules list
No rules loaded.
$ relay-core metrics
Metric                    | Value
--------------------------|-----------
Flows Total               | 128
Flows In Memory           | 100
Intercepts Pending        | 0
Rule Exec Errors          | 0
relay-core run Start proxy server
relay-core run --ui Start with TUI interface
relay-core ca generate CA certificate management
relay-core rules list Rule management
relay-core run --api-port 8082 Enable REST API
relay-core run --upstream http://corp-proxy:8080 Chain through a parent proxy (see Proxy Modes)
relay-core analyze --file flows.jsonl Offline analysis of flow dumps
relay-core flows --host example.com Search flows (requires --api-port)

Get Started

Cargo

cargo install relay-core-cli

npm

npm install -g @relay-core/cli

Build from Source

git clone https://github.com/relaycraft/relay-core && cd relay-core && cargo build --release