A leading colon such as :9090 expands to 127.0.0.1:9090.
Non-loopback safety enforcement: Binding to any non-loopback address (e.g. 0.0.0.0:9090) requires both a non-empty secret and explicit CORS origins (external-controller-cors or cors-allow-origins), or startup fails.
Authentication: When secret is non-empty, send Authorization: Bearer <secret> on HTTP requests, or ?token=<secret> on WebSocket upgrades. /ui, /ui/*, and CORS preflight OPTIONS requests (with an Origin header) are exempt.
CORS: Allows GET, POST, PUT, and PATCH (note: DELETE is not currently included in the CORS allow-methods list), headers Authorization and Content-Type, and allow-private-network: true by default.
Unix: Unix Domain Socket (parent directory created automatically; stale socket file removed before bind).
Windows: Named Pipe (e.g. \\.\pipe\clash-rs), secured by Windows SDDL (--controller-pipe-sddl or LISTEN_NAMEDPIPE_SDDL; defaults to D:(A;;GRGW;;;BU)(A;;GRGW;;;SY)).
No bearer-token auth: IPC relies on OS filesystem/pipe ACLs rather than secret.
Can run simultaneously alongside the TCP listener.
Any request carrying WebSocket upgrade headers (Connection: upgrade and Upgrade: websocket) for a path not starting with /ws is automatically rewritten internally to /ws<path> (preserving query parameters). Both /connections and /ws/connections work seamlessly for WebSocket clients.
Lists all proxies and proxy groups ({"proxies": {...}}).
GET
/proxies/{name}
Details for a single proxy or group (404 if missing).
PUT
/proxies/{name}
Selects an item in a select group (or pins/unpins a url-test group). Body: {"name": "<target>"}. Persists when profile.store-selected: true. Returns 202 Accepted.
GET
/proxies/{name}/delay
Latency test for a proxy or group. Required query params: ?url=<test_url>&timeout=<ms>. Returns {"delay": <ms>, "overall": <ms>}.
GET
/group
Lists all proxy groups ({"proxies": [...]}).
GET
/group/{name}
Details for a single proxy group (404 if not a group).
GET
/group/{name}/delay
Tests all members in a group. Required query params: ?url=<test_url>&timeout=<ms>. Returns {"<group_name>": <ms>}.
Flushes the Fake-IP mapping table (400 if Fake-IP is disabled; 204 on success).
POST
/cache/dns/flush
Flushes the DNS response cache (204 No Content).
GET
/dns/query
Queries the built-in DNS resolver (400 in system-resolver mode). Required query params: ?name=<domain>&type=<RRType> (invalid type defaults to A). Returns DoH-JSON (Status, Question, Answer, etc.).