Tauri Plugin
relay-core-tauri is RelayCore's Tauri v2 host adapter. It embeds CoreState inside your desktop app and exposes proxy lifecycle, flow inspection, intercept control, and CA management through Tauri commands. The RelayCraft desktop app is built on this plugin; you can integrate the same surface in your own Tauri host.
When to use it
- Run MITM proxy inside a desktop app instead of a separate CLI process
- Drive flow queries, breakpoints, and policy from your frontend via
invoke - Share the same runtime behavior as CLI, HTTP API, and MCP adapters
Where it sits
- Data plane:
relay-core-lib— capture and MITM - Orchestration:
relay-core-runtime—CoreState - Host adapter:
relay-core-tauri— Tauri IPC and flow event bridge
Quick integration
1. Add dependency
In your Tauri app's src-tauri/Cargo.toml (pin the same version as RelayCore):
[dependencies]
relay-core-tauri = { git = "https://github.com/relaycraft/relay-core", tag = "v0.5.2" }
tauri = { version = "2", features = [] } 2. Register the plugin
// src-tauri/src/lib.rs
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(relay_core_tauri::init())
.run(tauri::generate_context!())
.expect("error while running tauri application");
} Plugin ID: relay-core-tauri. Setup creates RelayCoreState (wrapping CoreState and TauriContext) and registers it with Tauri state.
3. Capabilities (Tauri v2)
The default permission set only allows start_core_proxy. For a full desktop workflow, allow the commands you need explicitly:
{
"identifier": "main-capability",
"windows": ["main"],
"permissions": [
"relay-core-tauri:allow-start-core-proxy",
"relay-core-tauri:allow-stop-core-proxy",
"relay-core-tauri:allow-get-core-status",
"relay-core-tauri:allow-get-flow-detail",
"relay-core-tauri:allow-get-pending-intercepts",
"relay-core-tauri:allow-resume-flow",
"relay-core-tauri:allow-install-ca-cert"
]
} 4. Start proxy from the frontend
import { invoke } from "@tauri-apps/api/core";
// Default port 8080; CA is written under app_data_dir
await invoke("plugin:relay-core-tauri|start_core_proxy", { port: 8080 });
const status = await invoke("plugin:relay-core-tauri|get_core_status");
console.log(status); For HTTPS interception, trust the CA first: start_core_proxy generates certificates in the app data directory, then call install_ca_cert to open the OS trust prompt (macOS / Windows).
Available commands
| Command | Description |
|---|---|
start_core_proxy | Start embedded proxy (optional port, default 8080) |
stop_core_proxy | Stop proxy |
get_core_status | Runtime status snapshot |
get_core_metrics | Prometheus-compatible metrics |
get_flow_detail | Flow detail by ID |
get_pending_intercepts | List pending intercepts |
resume_flow | Resume or drop paused traffic |
set_intercept_rule | Set intercept rule |
get_policy / update_policy / patch_policy | Proxy policy read/write |
load_script | Hot-load Deno script |
get_ca_cert_path | CA certificate path (proxy must be running) |
install_ca_cert | Open OS CA install prompt |
get_recent_audit | Recent control-plane audit events |
Typical workflow
// 1. Start proxy
await invoke("plugin:relay-core-tauri|start_core_proxy", { port: 8080 });
// 2. Install CA (user confirms trust in the OS dialog)
await invoke("plugin:relay-core-tauri|install_ca_cert");
// 3. Inspect and resume pending intercepts
const pending = await invoke("plugin:relay-core-tauri|get_pending_intercepts");
await invoke("plugin:relay-core-tauri|resume_flow", { id: "flow-id:request", action: "continue" }); CLI / MCP / Tauri
| Host | Best for |
|---|---|
relay-core-cli | Terminal debugging, script dev, CI |
relay-core-probe (@relay-core/mcp) | AI agents and IDE integration |
relay-core-tauri | Embedded desktop apps with native UI |
All three share the same runtime capability surface. See Quick Start for CLI and HTTP API for the REST control plane.