HTTP Control API and Web Console

[General]
external-http-controller = 127.0.0.1:9090
external-http-secret = your-secret-token
external-http-ui = true
external-http-cors = false

Chute provides an embedded HTTP Control API and Web Console, similar to Clash and Surge dashboards. The API exposes engine status, traffic, connections, DNS, policy controls, and configuration management through REST endpoints.

Surge's http-api = <secret>@<host>:<port> is read as external-http-controller plus external-http-secret. A profile may also spell the parts separately: http-api-secret, http-api-ui and http-api-cors are read as external-http-secret, external-http-ui and external-http-cors, and http-api-web-dashboard also as external-http-ui; the configuration is saved with the external-http-* keys. http-api-tls is not supported — the controller speaks plain HTTP — and only produces a notice.

external-http-controller (Default: disabled)

external-http-controller = 127.0.0.1:9090

The requests the console keeps resident while serving are capped at 4 MB on macOS and 1 MB on iOS, tvOS and Android.

The address and port for the HTTP control server. Use 127.0.0.1 for local-only access. Binding to any non-loopback address (for example 192.168.1.5:9090) requires an explicit external-http-secret — without one the server refuses to start and logs what is missing.

A wildcard address (0.0.0.0, ::, *) counts as non-loopback for this check, because it listens on every interface — the opposite of local-only. Accepted spellings are 0.0.0.0:9090, *:9090 (the same thing) and, for IPv6, [::]:9090 — a bare :::9090 is bracketed for you; an address that cannot be parsed is reported as a configuration error instead of silently leaving the controller off. The whole of 127.0.0.0/8 counts as loopback, not just 127.0.0.1.

external-http-secret (Default: a generated token)

external-http-secret = your-secret-token

The Bearer token used for API authentication. Requests must include the header Authorization: Bearer <secret> — the token is accepted only in this header, never as a query parameter, and is compared in constant time. Authentication failures return 401 with {"ok": false, "error": {"code": "unauthorized", "message": "missing or invalid token"}}. Every data route is guarded: the /api/* paths, the Clash-compatible aliases, and the older routes that only Chute Android still serves (/status, /policies, /dns, /records and the like), which accept the token only in this header as well. Chute Android's own Remote Dashboard now uses the /api/* paths only. The Web Console's page and static assets (/, /assets/…, and on Chute Android also /ui) need no token (with external-http-ui = false they are gone altogether — the page is a 404).

When the key is absent, Chute generates a token instead of serving without authentication. The generated token is written to a control-token file in Chute's share folder — not beside the configuration: the app-group container on iOS and tvOS, the app's private data directory on Android — with owner-only permissions, is reused across restarts, and the apps show it to you — see the console entry points. The control API can hand out the connection database, whose records carry every URL, header and process name the run has seen, so an open controller is not a reasonable default.

To serve without authentication anyway, say so in the configuration:

external-http-secret = none

That is accepted only on a loopback bind. Off loopback, neither none nor an absent key is enough: the controller refuses to start and says what it wants.

Upgrading: if you relied on an absent external-http-secret meaning "no authentication", local scripts start receiving 401. Either read the generated token out of the app, or write external-http-secret = none to keep the old behaviour deliberately.

external-http-ui (Default: true)

external-http-ui = true

When enabled, Chute serves an embedded Web Console at the controller address. The Web Console provides an overview, connection management, DNS inspection, traffic monitoring, policy controls, and configuration editing. Set to false to keep the API enabled while disabling the UI.

Opening the web console

The console is served at the controller's address, and each app can hand you the address and the token — including the generated one, which you would otherwise have no way to read:

  • Chute Mac: menu bar → Open Web Console, and Copy Web Console Token. A connection's detail window also has Requests & History, which opens the console — its home page, not that connection.
  • Chute iOS: Control Panel → the Web Console row → Open, Copy Address, or Copy Access Token.
  • Chute tvOS: the control panel has a separate Web Console Address row, showing host and port. Selecting it shows a QR code when the listener is reachable from other devices — the sign-in token travels inside the code, not on the screen — and, when the controller is bound to loopback, an explanation instead, because a loopback console cannot be opened from a phone.
  • Chute Android: Control Panel → Web Console Address → Open or Copy Address, and a Generated access token row that copies on tap. Neither row appears when the token is a secret you configured yourself, which is never displayed.

The address these produce carries the token as a query parameter. The page consumes it on load and removes it from the address bar, so opening the link is a complete sign-in and nobody has to transcribe 32 hex characters.


external-http-cors (Default: false)

external-http-cors = true

Enable CORS (Cross-Origin Resource Sharing) headers on API responses. Useful when the Web Console or third-party tools need to access the API from a different origin.

API Endpoints:

Method Endpoint Description
GET /api/status Runtime status, ports, uptime
GET /api/traffic Global and per-policy traffic counters
GET /api/connections Current active connections
DELETE /api/connections/:id Close a connection
GET /api/connections/history Historical connection records
GET /api/connections/processes Per-process connection statistics
GET /api/connections/:id/request Captured request data for a connection
GET /api/connections/:id/response Captured response data for a connection
GET /api/dns DNS cache records
DELETE /api/dns/cache Purge DNS cache
DELETE /api/dns/records/:domain Remove a single DNS record
GET /api/config Current configuration
PUT /api/config Reload configuration
POST /api/config/validate Parse a configuration and report its errors, without loading it
GET /api/policies Policy groups and current selection; every entry carries hidden, which is true for a group marked hidden=true
PUT /api/policies/:group Change policy group selection
PUT /api/mode Set outbound mode
GET /api/features Feature switch states
PUT /api/features/mitm Toggle MitM
PUT /api/features/record-traffic Toggle traffic recording
GET /api/rules The rule table the matcher walks, where each rule came from, and which rewrite rules have fired
POST /api/rules/match Where a request would be routed, without making it
GET /api/rules/user Rules added at run time, matched ahead of the modules and the configuration
PUT /api/rules/user Replace the run-time rules
POST /api/rules/user Add rules behind the run-time rules
DELETE /api/rules/user Remove every run-time rule
GET /api/logs Recent log entries
GET /api/loglevel Current log level, and the sections being written
PUT /api/loglevel Change the log level or sections without restarting
GET /api/health Engine health: refusals, generations, footprint, previous exit
GET /api/events Notable moments of this run
GET /api/tailscale Live Tailscale engine state
GET /api/scripts The generic scripts that can be run on demand
POST /api/scripts/run Run one generic script by name
POST /api/diagnostics/ping ICMP or TCP reachability probe
POST /api/diagnostics/dns-query Resolve a domain through the running resolver
POST /api/diagnostics/egress-probe Check the address: this device's own on the Apple engines; on Android, the device's public address on its physical network, not a proxy's exit
POST /api/diagnostics/internet-test The direct Internet test: fetch internet-test-url without a proxy
POST /api/diagnostics/url-test/:policy Run a policy's latency test
POST /api/diagnostics/bundle Build a redacted diagnostic archive
GET /api/connections/export Export connections as HAR 1.2
GET /api/rewrites Every rewrite/Mock Response family, plus the MitM host list
GET /api/rewrites/:family One family's rules
POST /api/rewrites/:family Add a rule
DELETE /api/rewrites/:family/:id Remove a rule
DELETE /api/rewrites/:family Clear a family
GET /api/mitm/hosts Hosts currently decrypted
POST /api/mitm/hosts Add a host
DELETE /api/mitm/hosts/:host Remove a host
DELETE /api/mitm/hosts Clear the list
GET /api/rules/providers Rule providers and rule sets, with the status of each — including why one did not load

Endpoint notes:

  • GET /api/features reports each switch as it is set — record_traffic, mitm, mitm_h2, mitm_auto_quic_block, rewrite — and licensed. effective says what actually runs, for five items only: record_traffic, mitm, rewrite, scripts and lan_proxy. On the free edition all five are false, so a switch can read on while its effective entry is false. inactive is an object naming what the running configuration asks for that does not run in this edition: the counts scripts, scriptRules, dnsScripts, rewrites and mapLocals, and the flags mitm, bodyCapture, lanProxy and exitNode (Tailscale advertising, which only Chute Mac does). With a license, or while the engine is stopped, every count is 0 and every flag false.
  • GET /api/connections accepts limit (positive integer, default and maximum 1000) and cursor (returns only connections with id greater than the cursor). The response data carries connections, total, page_size, has_more, server_time, and — when more pages exist — next_cursor. since (seconds, the server_time of an earlier answer) returns only the connections that changed after that moment, and adds active_ids, the ids of every connection open now: one that an earlier answer had and that is missing from them has closed. A since later than server_time is taken as 0, so every connection is returned.
  • GET /api/connections/history accepts limit (default 100, maximum 1000) and cursor/before (synonyms; passing both is rejected).
  • GET /api/connections/:id/request and .../response return {"connection_id": <id>, "data": "<base64>"}. Captures larger than 2 MiB return 413. Without Chute Pro both return 403, with request data is not available or response data is not available, for bodies recorded during an earlier licensed run as well.
  • GET /api/config returns the running configuration as written, credentials included — http-auth, external-http-secret, ca-p12, ca-passphrase, WireGuard keys and every proxy's password — so access to the control API is access to all of them. Only a diagnostic bundle replaces credentials with <redacted>, and that copy cannot be loaded back: a configuration sent to PUT /api/config that still says <redacted> anywhere is refused with 400 and a message naming the first such line. Submit the original configuration instead.
  • GET and PUT /api/config are also reachable as /api/configs, and as the Clash alias /configs.
  • PUT /api/config accepts either JSON {"configuration": "<full text>"} or the raw configuration text as the request body (1 MB limit). On success the engine reloads — or starts, if it was not running.
  • PUT /api/policies/:group takes the selection from the first of the body keys policy, name, selected, select; the value may be a policy name or a numeric index as a string. The special group name GLOBAL sets the global selected policy.
  • In GET /api/policies, every policy, group and group member carries endpoint, the policy it leads to now — followed through groups, and through the built-in PROXY to the policy selected for Global mode — and endpoint_ping, that policy's latency. A group's own ping is 0, not measured, so endpoint_ping is the figure to read for a group or for PROXY.
  • PUT /api/mode requires a JSON number: {"mode": 0} — 0 rule, 1 direct, 2 proxy.
  • PUT /api/features/mitm and PUT /api/features/record-traffic take {"enabled": true}.
  • GET /api/logs accepts since (Unix seconds); the in-memory buffer keeps the most recent 1000 entries, each {timestamp, wall_time, level, section, message} — timestamp and wall_time carry the same Unix-seconds value, nudged forward when the clock does not advance so entries stay strictly ordered.
  • GET /api/health reports what the engine is holding and why it last refused something, plus how the previous run ended (clean, unclean, or suspected_memory — see Troubleshooting). addressFamily says how Chute judges the IPv6 way out — ipv6 is healthy, confirming or degraded — with counts of what it has done about it; on the Apple engines selfLoop reports the self-loop guard. Neither carries an address.
  • GET /api/events serves the in-memory ring; ?persisted=1 reads this run's stored history instead, and answers available: false when record keeping is off.
  • GET /api/tailscale answers state: "idle" when no [Tailscale] section is configured — that is a normal answer, not an error.
  • The POST /api/diagnostics/* probes take their arguments from the query string or a JSON body, are bounded to ten seconds, and answer exactly once. url-test/:policy rejects a policy name that is not defined rather than measuring REJECT.
  • GET /api/scripts lists the enabled generic scripts as {name, type}; POST /api/scripts/run takes name from the body or the query string, is bounded like the diagnostics probes, and answers {name, timedOut, result} — timedOut tells a script that never called $done apart from one that ran to completion. A name that is not an enabled generic script is a 404. Without Chute Pro it answers 403, script is not available.
  • POST /api/rules/match answers where a request would go, without opening a connection. It takes host (or a url to take the host and port from; a URL-REGEX rule is tested against that url exactly as written, although in real traffic it only ever sees plain http:// requests), port (default 443), and optional ip, protocol, process, process_path, src_ip, src_port, in_port, in_type, in_user, in_name, network, ssid, bssid, from_tun, user_agent — an unknown field is refused with the accepted list rather than ignored. The reply carries the matched rule (its line, type, the policy it names and the resolved_policy a group currently points at), the policy, need_resolve, and the rule_count and match_generation the answer was computed against. Because a domain is matched twice — once on the name and again once an address is known — passes holds one entry per pass; without an ip only the pre-resolution pass exists and the reply says so in note. Add explain=true for the candidate rules that could also have matched, up to 50, with a count of the rule sets that were not expanded.
  • POST /api/config/validate parses a configuration and throws it away: the running engine adopts nothing. Send it as {"configuration": "<full text>"} or as the raw text. The reply is valid, error_count, advisory_count, rule_count, policy_count and an errors list of {line, severity, content, error} — severity separates a line that was refused from one accepted with a caveat, and content is the offending line as written — credentials included, since a bad [Proxy] line is often bad in the very field that holds its password — cut at 4096 characters. Use it before PUT /api/config, which restarts the run you are debugging.
  • GET /api/loglevel reports the current level, the nslog_level, the sections being written to file, and the available_levels / available_sections you may set. PUT (or PATCH) takes level, sections, or both: sections is an array of section names or the string "all", and an empty array is refused — to stop logging use level none. Changing the level this way does not restart the run, which is the point: loglevel = verbose in the file needs a reload, and a reload loses the thing you were trying to see.
  • GET /api/rules also reports rewrite_hits — every rewrite or Mock Response rule that has fired this run, with a count. A rule that does not appear there has never matched, which is the usual explanation for a rewrite that seems to do nothing. The table tracks up to 512 distinct rules and reports rewrite_hit_dropped_rules for any beyond that. rules lists every rule the matcher walks, in order: the automatic Tailscale rules, then the rules added through /api/rules/user, then module rules, then the configuration's [Rule] section, ending with FINAL; rule_regions names each line's origin, index for index (front, user, module, configuration).
  • /api/rules/user holds rules added while the engine runs, without a reload and without touching the configuration file. They are matched after the automatic Tailscale rules and ahead of module rules and the configuration's [Rule] section, in the order given. GET lists them; PUT replaces them and POST adds behind the ones there, both taking {"rules": ["<rule line>", ...]} or a single {"rule": "<rule line>"}, written as in the file; DELETE removes them all. A write is all or nothing: a line that does not parse, or a FINAL, is refused with 400 and the rules stay as they were. A rule whose policy the running configuration does not define is taken — it fails closed with REJECT — and named in warnings. close_rerouted, true by default, closes the connections the changed rules route elsewhere, and only those; false leaves every connection open — on DELETE pass it as ?close_rerouted=false. Every method answers with the current rules. The rules are kept through a reload and are gone when the engine stops. PATCH is not accepted on this path.
  • POST /api/rewrites/:family takes {"rule": "<configuration line>"} — the same text you would write in the file. A line that does not parse is refused with 400 rather than stored as a rule that can never match. :family is one of url-rewrite, header-rewrite, body-rewrite, mock. Rules added this way live in the running engine and are not written back to the configuration file.
  • GET /api/connections/export?format=har returns a HAR 1.2 document, and POST /api/diagnostics/bundle returns a zip — both are files, so unlike every other endpoint they are not wrapped in the {"ok": ..., "data": ...} envelope. export accepts source (current, the default, or history), limit (default 100, maximum 300), ids, and bodies=1 to include the captured payloads. Each entry carries a _kl object with what HAR has no field for: the chosen policy, the matched rule, and the rewrites that fired.
  • A chained connection's record in GET /api/connections and GET /api/connections/history carries chainPath, the path from this device to the exit, as in Airport/HK-01 → Landing; it is empty for a connection that used a single policy, and the HAR export carries it as _kl.chain. In the per-policy counters of GET /api/traffic, an upstream also counts the bytes it carried for chained connections; the global totals count them once.

Example — read the status, then switch a policy group:

curl -H "Authorization: Bearer your-secret-token" http://127.0.0.1:9090/api/status
{"ok":true,"data":{"running":true,"outbound_mode":0,"mitm":false, ...}}

curl -X PUT -H "Authorization: Bearer your-secret-token" \
     -d '{"policy": "ProxyB"}' http://127.0.0.1:9090/api/policies/MainGroup
{"ok":true,"data":{"outbound_mode":0,"selectable_groups":[...], ...}}

Example — ask where a request would go, before making it:

curl -X POST -H "Authorization: Bearer your-secret-token" \
     -d '{"url": "https://api.example.com/v1/orders", "explain": true}' \
     http://127.0.0.1:9090/api/rules/match
{"ok":true,"data":{"policy":"MainGroup","matched":{"rule":"DOMAIN-SUFFIX,example.com,MainGroup", ...}, ...}}

Narrow the log to one subsystem while reproducing, without restarting the run:

curl -X PUT -H "Authorization: Bearer your-secret-token" \
     -d '{"level": "verbose", "sections": ["MitM", "DNS"]}' \
     http://127.0.0.1:9090/api/loglevel

Note: This feature is disabled by default. Every response uses the envelope {"ok": true, "data": {...}} on success and {"ok": false, "error": {"code": "...", "message": "..."}} on errors; request bodies are limited to 1 MB.

PUT endpoints also accept PATCH. Clash-compatible alias paths are available for third-party dashboards: /version, /traffic, /connections, /configs, /proxies, /rules — the paths are reachable, but responses use Chute's envelope and field names rather than Clash's schema (/version returns {"name", "run_id", "egress_probe"}, where egress_probe is network_address on the Apple engines and egress_ip on Android), so Clash dashboards will not work out of the box.

S. Smart Rabbit LLC © All Rights Reserved            updated 2026-11-19 16:07:28

results matching ""

    No results matching ""