Skip to content

REST API Reference

meow-rs exposes an Axum-based REST API for runtime control, compatible with the Clash/mihomo external-controller surface that dashboards like metacubexd and yacd expect.

Enabling

yaml
external-controller: 127.0.0.1:9090
secret: "a-long-random-string"

Without external-controller, the API does not start. See Authentication for the auth model.

  • REST auth: Authorization: Bearer <secret>.
  • WebSocket auth: the bearer header or ?token=<secret>.
  • CORS: permissive (Access-Control-Allow-Origin: *).
bash
curl -H 'Authorization: Bearer <secret>' http://127.0.0.1:9090/proxies

Dashboard

A web UI is served at /ui. By default it's the built-in panel; set external-ui to serve a third-party dashboard's static files instead.

Meta

MethodPathDescription
GET/Health check — returns "meow-rs"
GET/version{ version, meta: true }

Proxies

MethodPathDescription
GET/proxiesAll proxies and groups
GET/proxies/{name}One proxy/group (name, type, alive, history, udp, all, now)
PUT/proxies/{name}Select a member in a group — body { "name": "member" } → 204
GET/proxies/{name}/delayProbe delay — query url, timeout, expected
GET/group/{name}/delayProbe every member of a group

Rules

MethodPathDescription
GET/rulesList active rules (type, payload, proxy)
POST/rulesReplace all rules — body { "rules": ["...", ...] } → 204
PUT/rulesUpdate one rule — body { "index": n, "rule": "..." } → 204
DELETE/rules/{index}Delete the rule at an index → 204
POST/rules/reorderMove a rule — body { "from": i, "to": j } → 204

Connections

MethodPathDescription
GET/connectionsSnapshot: totals + per-connection src/dst/chains/rule/upload/download/start
DELETE/connectionsClose all connections → 204
DELETE/connections/{id}Close one connection by UUID → 204

Config

MethodPathDescription
GET/configsCurrent mode, log-level, ports, controller
PATCH/configsUpdate mode and/or log-level → 204
PUT/configsHot-reload the whole config (below)
POST/api/config/savePersist the current config to disk

PUT /configs accepts { "path": "/path/to/config.yaml" } or { "payload": "<base64-yaml>" }. Add ?force=true to apply despite validation errors (logged). Returns 204 on success, or 400 { message } on a parse/validation failure.

Traffic & metrics

MethodPathDescription
GET/trafficCumulative { up, down } bytes
GET/metricsPrometheus exposition (traffic, active connections, proxy alive/delay, rule matches, RSS, build info)

DNS & caches

MethodPathDescription
GET/dns/queryResolve — query name (type ignored) → { name, answer: [...] }
POST/dns/queryResolve via POST body { name, type? }
POST/cache/dns/flushClear the DNS cache → 204
POST/cache/fakeip/flushClear FakeIP allocations → 204

Providers

MethodPathDescription
GET/providers/proxiesList proxy providers
GET/providers/proxies/{name}One proxy provider
PUT/providers/proxies/{name}Refresh (re-fetch) → 204
GET/providers/proxies/{name}/healthcheckHealth-check all proxies in it
GET/providers/rulesList rule providers
GET/providers/rules/{name}One rule provider
PUT/providers/rules/{name}Refresh a rule provider

Proxy groups

MethodPathDescription
GET/api/proxy-groupsList groups
POST/api/proxy-groupsCreate a group
PUT/api/proxy-groups/{name}Update a group → 204
DELETE/api/proxy-groups/{name}Delete a group → 204
PUT/api/proxy-groups/{name}/selectSwitch active member → 204

Subscriptions

MethodPathDescription
GET/api/subscriptionsList, with counts and last-updated
POST/api/subscriptionsAdd { name, url, interval? } and apply
POST/api/subscriptions/{name}/refreshRe-fetch
DELETE/api/subscriptions/{name}Remove and clear its contents → 204

Listeners

MethodPathDescription
GET/listenersActive listeners (name, type, port, listen)

WebSocket streams

Authenticate with the bearer header or ?token=<secret>.

PathQueryStream
/logslevel=debug|info|warning|error|silentLog lines { type, payload, time }
/trafficPeriodic { up, down } deltas
/memoryMemory / RSS stats
bash
# tail logs over WebSocket
websocat 'ws://127.0.0.1:9090/logs?level=info&token=<secret>'

Released under the GPL-3.0 License. A Rust take on the mihomo proxy kernel.