relay-core — zsh
$ relay-core-cli --version
relay-core-cli 0.5.2

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

$ relay-core-cli run --listen 127.0.0.1:8080
RelayCore proxy started
  Proxy   127.0.0.1:8080
  Control http://127.0.0.1:8081/
  CA      cert=~/.relay-core/ca_cert.pem key=~/.relay-core/ca_key.pem

RUST-BASED TRAFFIC INTERCEPTION ENGINE

Zero-copy async runtime. Sub-millisecond overhead.
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.

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

>10K
req/s
Throughput (S1)
<200
ms
Cold Start
<50
MB
Idle RSS
<5
ms
P99 Latency Add
Metric RelayCore mitmproxy Charles
Language Rust Python Java
Throughput 10K+ req/s ~1K req/s ~2K req/s
Memory (idle) 38MB ~150MB ~300MB
P99 Overhead <5ms ~50ms ~30ms

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