* feat(config): validate ECH config lists and share-link queries * feat(outbound): harden ECH validation, discovery and Chrome GREASE * feat(subscription,native-api): import Clash and sing-box ECH and tighten offline capture * docs(ech): document ECH validation, subscription import and changelog
44 KiB
Subscription reference
subscription {} configures remote node lists.
subscription {
primary: 'https://example.com/sub'
'https://example.com/no_tag_link'
detailed: 'https://example.org/sub' {
ua: 'honk/1.0'
interval: 6h
cache: false
route: direct
}
}
Fields
To set options for one subscription, add a block after the quoted URL, one key per line. None is required. An omitted option takes the matching assets.subscription default, or assets.route for route, before the built-in default. See the assets reference.
| Key | Default | Meaning |
|---|---|---|
ua |
honk/<version> |
Override the request User-Agent; see ua. |
interval |
86400s |
Set the periodic refresh interval; see interval. |
cache |
true |
Keep this subscription's body in the subscription store; see cache. |
route |
routing |
Select the fetch route; see route. |
ua
Send this value as the request User-Agent. It defaults to honk/<version>.
ua: '' resets an inherited assets.subscription.ua to honk/<version>; it does not remove the User-Agent header. A value that is not a valid HTTP header value fails the fetch.
interval
Set the refresh interval. It defaults to 86400s; 0 disables periodic refresh and failure retries.
The value is whole seconds, either bare or with a lowercase s, m or h suffix. ms values are milliseconds and round up to whole seconds. d, compound values such as 1h30m, and fractions such as 0.5s are invalid.
An invalid value warns and becomes 0. It does not fall back to the inherited value.
cache
With global.store_subscribe, keep this subscription's fetched body in the subscription store for offline startup. It defaults to true.
cache accepts true, yes, 1, on, false, no, 0 and off, in any case.
false neither stores nor restores the body, and maintenance deletes a body kept earlier. An invalid value warns and becomes true.
Changing global.store_subscribe requires a restart; SIGHUP rejects the change.
route
Select the route that fetches this subscription's URL. It defaults to routing.
| Route | Behavior |
|---|---|
Empty or routing |
Apply traffic-routing rules to each URL, including redirects. Rules may select a node, group, direct, or block. |
| Group name | Force that group. |
direct |
Use the bootstrap resolver and bypass mark to connect directly to the host, without routing. This retains the previous direct transport. |
An empty route follows routing in every build. honk rejects an unknown group during validation. If the route must work at first start, see First start when the subscription URL is blocked.
Entry syntax
Declare the URL on the entry line. Two legacy forms still parse without a warning:
| Form | Example |
|---|---|
(UA) suffix after a quoted URL |
compatible: 'https://example.net/sub'(honk/1.0 like) |
| URL inside a block | detailed: { url: '…' ua: '…' } |
Only the URL-inside-a-block form accepts download_detour as an alias for route; setting both fails with conflicting-subscription-route. After a URL on the entry line, download_detour is an unknown key and is ignored with a warning. The suffix and joined-comment rules below apply to the (UA) form.
Tags are optional. Tags and URLs may use matching single or double quotes.
| Entry form | Tag parsing |
|---|---|
| Bare entry | Text before the first : is the tag, unless that colon begins ://. Later URL colons do not split a tag. |
Quoted tag followed by : |
Explicit tag. |
| Quoted URL without an explicit tag | Remove the enclosing quotes, then apply the first-colon rule. 'paid:https://example.com/sub' has tag paid; 'https://example.com/sub' is tagless. |
The whole-quoted form 'paid:https://example.com/sub' warns with legacy-embedded-tag; write paid: 'https://example.com/sub' instead.
The (UA) suffix requires a quoted URL, so parentheses in bare URLs remain unambiguous. Both forms retain sub_type: simple, which automatically detects the supported body formats below.
The link suffix is parsed before embedded-tag normalization: 'paid:https://example.com/sub'(agent) and 'paid:https://example.com/sub'#note retain tag paid. Diagnostic entry ordinals count both block and inline declarations in source order, including skipped entries.
For a quoted head, only a colon immediately after the closing quote (allowing whitespace) declares an explicit tag. Colons in an unquoted User-Agent or glued comment suffix remain suffix data: 'https://example.com/sub'(agent:1) is still tagless.
A tagless entry uses its URL host as its name: 'https://example.com/sub' becomes example.com. A URL without a parseable host leaves the name empty and fails validation. Name uniqueness is not enforced: an explicit example.com tag and a tagless URL on that host share the same subtag(example.com) filter, which selects nodes from both subscriptions. Host-derived naming applies only to dae; JSON, YAML, and TOML still require name.
Tagless text without :// is ignored. Explicitly tagged entries still reach validation, which requires a non-empty name and an HTTP(S) URL. file://, http-file://, and https-file:// remain unsupported.
On entry lines, # starts a comment outside matching quotes at the start of the statement or immediately after an ASCII space or tab. In a bare URL, a glued # remains data, including after parentheses: https://example.com/sub?filter=(hk)#token. Quote a User-Agent containing a spaced #: 'https://example.com/sub'('agent # build'); without UA quotes, the comment cuts off the suffix.
After a quoted URL, a glued # immediately after the closing quote or one balanced (UA) suffix is accepted as a comment, with legacy-glued-hash at that byte and the guidance “put whitespace before a comment”. 'http://q'#c and 'http://q'(ua)#c keep URL http://q, with UA ua only in the second form. Parentheses inside matching quotes do not affect nesting. A glued # inside the suffix remains UA data, including in (Mozilla/5.0 (X11; (Linux)#build)). Other trailing text, including (ua)(x) or (agent) junk, skips the entry with trailing-entry-text or legacy-ua-boundary.
The glued-tail compatibility handling runs after block recognition. It does not treat the # as a lexical comment. In sub: 'http://q'(ua)# }, the separated } still closes the subscription block, so subsequent entries can fall outside it. Write (ua) # } to make the brace comment data instead.
Quote-error and block rules are listed in the dialect reference.
Internal model
| Field | Type | Default | Settable in dae | Meaning |
|---|---|---|---|---|
id |
UUID | random UUID | No | Runtime subscription identity; SIGHUP preserves it when the fetch identity (URL + configured ua + headers) matches an existing subscription. A structured configuration that sets id needs a non-nil value unique across all entries. |
name |
string | "" |
Yes, as the tag; otherwise the URL host | Display tag and the value used by group subtag(...) filters and DNS subtag(...) rules. |
url |
string | "" |
Yes | HTTP(S) fetch URL. |
sub_type |
enum | simple |
No | Body parser: simple, clash, sip008, or custom. |
update_interval |
u64 | 86400 |
Yes, as interval |
Periodic refresh interval in seconds; 0 disables periodic refresh. |
user_agent |
string or null | null | Yes, as ua |
Optional User-Agent override; null or empty sends honk/<version>. |
headers |
{key,value}[] |
[] |
No | Ordered extra request headers; a repeated name is sent repeatedly. An invalid header name or value fails the fetch. |
download_detour |
string | "" |
Yes, as route |
Fetch route; see route. |
enabled |
bool | true |
No | Disabled subscriptions are not restored, fetched, or refreshed. |
cache |
bool | true |
Yes, as cache |
Body caching for offline startup; see cache. |
last_updated |
datetime or null | null | No | Model metadata; the current core runtime does not update it. |
node_count |
u32 | 0 |
No | Model metadata; the current core runtime does not update it. |
created_at |
datetime | construction time | No | Model construction time. |
Body parser selection:
sub_type |
Parser behavior |
|---|---|
simple |
Detects share-link lists, Clash YAML/JSON, SIP008, sing-box JSON/YAML, and supported client records. |
clash |
YAML or JSON with a top-level proxies sequence. |
sip008 |
SIP008 servers objects or a bare server array; not a share-link list. |
custom |
The same format detection as simple. |
honk-tool sub uses the same parser for downloaded bodies and local files.
Fetch, persistence, and recovery
global.store_subscribe defaults to true. When enabled, the runtime opens a private subscription store and fetches every enabled subscription immediately. Requests identify as honk/<version> unless user_agent supplies an override. A non-zero update_interval schedules later refreshes.
| Property | Current behavior |
|---|---|
| Location | The subscription_body table of the state db, <data_dir>/state/honk.db. The file is 0600 in a 0700 directory. See the API reference. The default data_dir is /var/lib/honk. |
| Key | URL-safe Base64 of a SHA-256 hash plus .sub. The hash covers the length-delimited URL, the configured user-agent override (empty when unset or empty), and the ordered header key/value pairs. The versioned default request UA is intentionally not part of the key, so default subscriptions retain their body across upgrades. The request identity is not exposed in plaintext. |
| Write boundary | After HTTP success and body acceptance, the complete raw response, including rejected entries, is written in one transaction. |
| Limits | Each body is at most 8 MiB, and all bodies together at most 32 MiB. A write that would pass 32 MiB first deletes bodies of subscriptions that are no longer enabled. If that is not enough, the write is refused, the previous body stays, and the fetch reports subscription-store-write-failed. A body whose subscription is not enabled at two consecutive maintenance ticks (every 60 seconds) is deleted. A start with store_subscribe: false empties the table even when cache_file, password_auth or --store db still opens the state db. |
Upgrade from .sub |
Import eligible legacy bodies after acquiring the instance lock, as described below. |
| Redirects | At most 5 hops. A redirect from https to another scheme fails the fetch. So does a redirect to a loopback, private, link-local, or unspecified literal address that the configured URL did not itself use. A hostname resolving to such an address is not detected. |
| Body size | At most 8 MiB, enforced while reading rather than after the body is buffered. |
Legacy .sub import runs at startup after the instance lock is held:
- Select the first private legacy store in
<data_dir>/.sub,/var/share/honk/.sub, then./.sub. - Copy bodies for enabled subscriptions, retaining bodies already in the state db.
- Unlink copied
*.subfiles and every.*.tmpfile in that directory. Remove the directory if empty. Leave other legacy locations unchanged.
Unreadable bodies, bodies over 8 MiB, and bodies that would exceed the 32 MiB total remain in place with a warning. Bodies of disabled subscriptions also remain. A later startup that enables such a subscription can import its body without fetching it.
The previous process has exited before import, so its final body writes are copied like the others. An older binary started afterward finds only the bodies left behind and fetches the others again.
Subscription bodies and their nodes remain runtime state. Neither is written back into the dae configuration.
Subscription fetches follow routing unless the entry's route or assets.route overrides it. This matches other downloads honk initiates.
Routed requests share route decisions and tunnels with geodata and external UI downloads. They retain the same User-Agent, headers and download constraints:
| Constraint | Behavior |
|---|---|
| Timeout and body size | 30 seconds; at most 8 MiB. |
| Redirect status | Only 301, 302, 303, 307 and 308; at most 5 hops. |
| Redirect destination | Never HTTPS to HTTP, or a public address to a private literal address. The redirect restrictions in the preceding table also apply. |
| URL userinfo | Sent as basic authentication. |
| Change of scheme, host or port | Drop Authorization, Cookie, Cookie2, WWW-Authenticate, Proxy-Authorization and a configured Host. |
| Referer | Set to the previous URL without userinfo or fragment. |
Builds without native-api fetch subscriptions over the same route.
A subscription can route through nodes it provides itself, for example when the rules send its URL to a group made only of its own nodes. On a fresh install those nodes do not exist yet. honk never falls back to direct. When the chosen route has no usable node, the fetch fails with an error that names the subscription and the outbound. The error says the route cannot carry the download yet, and suggests route: direct for that subscription. The provider status in the native API reports last_error.code as route_unavailable. Nodes restored from the stored body stay in service throughout.
Startup restores nodes before refreshing subscriptions:
- Parse stored bodies before starting network refreshes. A valid restored body supplies active nodes immediately. Missing, invalid or empty stored bodies are ignored.
- Wait for direct subscriptions without a valid restore to finish fetching, within one shared five-second deadline. A valid restore excludes that subscription from the wait. Its refresh still runs in the background.
- Make routing ready after the startup subscription pass, then fetch routed subscriptions.
A later accepted refresh replaces the SQLite body row, not a legacy file.
If a restored or first-fetched body contains a node ID already used by an inline node, startup excludes that subscription instead of failing, and runtime publication rejects the same collision. A node whose ID another subscription already published is dropped from this subscription with a warning, and its other nodes are published. The first subscription keeps the node. A body may still replace its own subscription's nodes.
The native API provider reports last_error.code as publication_rejected and last_error.details.diagnostic_code as duplicate-node-id. A restored body rejected this way still counts as restored: it skips the first-fetch wait. Background refresh still runs and repeats the check.
On SIGHUP, subscriptions with the same fetch identity (URL + configured ua + headers) retain their runtime ID. The reload carries active nodes belonging to still-enabled subscriptions, commits the rebuilt configuration, and then starts an immediate background refresh. It does not read stored bodies, even when no nodes survive for a subscription. Stored-body recovery runs only at startup.
Failure handling preserves a usable runtime rather than clearing it:
- HTTP, invalid UTF-8 encoding, parse, or no-usable-node failure publishes no replacement nodes and performs no write, so the active nodes and last valid stored body remain. Accepted bodies are persisted byte-for-byte, without repairing encoding.
- Fetch failures first retry after the smaller of 30 seconds and
interval, then double the delay up to the smaller of 10 minutes andinterval.interval: 0disables automatic retries. Publication acceptance or rejection clears existing backoff and resumes the normal interval. - A persistence-write failure after parsing is non-fatal. The newly parsed nodes are still returned for publication, and the atomic path never installs a partially written body. The next restart can therefore restore whichever complete valid body remains on disk.
- An unsupported or malformed node is skipped individually. The shared node builder's warning includes a one-based entry index and a static rejection reason. Stream-normalization failures also retain the canonical field, such as
proxies[1].xhttporoutbounds[1].ws_headers, without exposing supplied header names, values or credentials. The whole body fails only when no usable nodes remain. An empty result never clears the previous generation.
The last valid body is the last body accepted by the current import policy, not the last successfully published runtime generation. A partial body with one distinct usable node may replace the stored body; an all-invalid body cannot. Restore reparses with the current policy and may reject a body saved by an older version. Runtime collection or publication failure after a successful write retains the active generation but can leave the new body on disk. Disk and active state are not one transaction.
First start when the subscription URL is blocked
If the subscription URL is blocked or its domain is poisoned, add a reachable static proxy node and set the subscription's route to a group containing only that node.
This group is available at first start and does not depend on nodes from any subscription.
Replace the SOCKS5 address below with a proxy that can reach the provider, and replace the subscription URL with your own.
node {
bootstrap: 'socks5://192.168.1.2:1080'
}
group {
Bootstrap {
filter: name(bootstrap)
}
}
subscription {
provider: 'https://example.com/sub' {
route: Bootstrap
}
}
Subscription body formats
All accepted nodes receive the subscription ID. Duplicate derived node IDs retain the first usable occurrence; rejected entries do not reserve an identity. Later duplicates report both original indices. Array indices are one-based before normalization; URI and record indices are physical lines, including blanks and comments. Decoded Base64 has a child source referring to its original body, not fabricated encoded-byte offsets. Importing a full client profile extracts its nodes, not its DNS, routing, groups, or remote-provider configuration.
Normalized entries are admitted incrementally, without retaining a body-sized list of outcomes. Each body retains at most 128 nonterminal diagnostics, followed by one subscription-diagnostics-truncated summary with the omitted count. A terminal body failure is retained separately. The caller's existing diagnostic prefix is untouched and does not consume this budget. The limit applies to structured, URI and record imports, including decoded Base64 and restored bodies. It never stops valid-node admission or changes first-usable duplicate selection.
simple and custom first try standard or URL-safe Base64, so Base64 can wrap any detected format, not only share-link lists. clash and sip008 expect an unencoded body.
| Diagnostic | Outcome |
|---|---|
malformed-subscription-entry |
Skip an entry with invalid fields or syntax. |
unsupported-subscription-entry |
Skip an entry that needs an unsupported protocol or feature. |
duplicate-subscription-entry |
Skip a later entry with the same node identity. |
subscription-profile-entry |
Ignore non-proxy profile content. |
invalid-subscription-encoding |
Reject a body that is not UTF-8, including decoded Base64. |
invalid-subscription-body |
Reject a structured body that does not parse. |
empty-subscription-body |
Reject a body with no usable node. |
Clash, SIP008, and sing-box credential scalars preserve string bytes and convert native finite numbers to the source format's canonical decimal text. Missing or null values are absent. Booleans, lists, maps, and nonfinite numbers reject the entry. A valid alias cannot hide an invalid supplied credential. Numeric UUIDs still fail UUID validation. Empty passwords remain subject to each protocol's requirements.
Share-link lists
A list can be plain text or standard/URL-safe Base64, with optional padding and ASCII whitespace between encoded chunks. A leading UTF-8 BOM is accepted in raw and decoded bodies. Each line contains one share link:
# blank lines and comments are ignored
socks5://user:password@127.0.0.1:1080#local
vless://00000000-0000-4000-8000-000000000000@example.com:443?security=tls#edge
Blank lines, comments, and Shadowrocket REMARKS= / STATUS= metadata lines are ignored and produce no node warning. Every remaining line is parsed by Node::from_share_link. Unsupported or malformed lines are skipped with a warning; malformed or unsupported ECH entries (such as invalid Base64/RFC 9849 payloads, conflicting ECH query parameters, or unsupported ech= resolver URLs) are skipped individually (malformed-subscription-entry) without rejecting healthy siblings in the same subscription. Share links with a non-empty proxy plugin are also skipped because honk does not execute plugins. The body is rejected when it contains no supported node URI, including metadata-only bodies. See the node reference for canonical share-link fields and protocols.
Clash YAML and JSON
A full profile or provider payload must contain a top-level proxies sequence. Entries without a supported type, server address, valid nonzero port, or required credentials are skipped. Ports may be integers or numeric strings. JSON is decoded natively, including UTF-16 surrogate-pair escapes in display names.
Accepted type values are socks5, ss/shadowsocks, trojan, vmess, vless, hysteria2/hysteria, tuic, juicity, and anytls. Unrelated client metadata is ignored. Unsupported wire transports, proxy plugins, and contradictory security settings are not silently reinterpreted.
Common proxy fields
| Clash field | Internal field | Rule |
|---|---|---|
name |
name |
Defaults to <type>-<server>:<port>. |
server, port |
host, port, address |
Required address and nonzero u16 port; numeric port strings are accepted. |
username |
username |
Optional string. |
password |
password |
Optional string; VLESS applies the precedence below. |
cipher |
encryption |
Optional string; VLESS applies the precedence below. |
plugin, plugin-opts, plugin_opts |
— | Unsupported. An entry with any non-empty value is skipped before node publication. Mapping-valued options are rejected too. |
network |
transport or packet capability |
Trojan/VMess/VLESS use a stream transport (tcp, ws, grpc, or xhttp); AnyTLS uses packet capability. |
tls |
tls |
Optional boolean. Trojan, AnyTLS, Hysteria2, TUIC, and Juicity default to TLS and reject explicit disabling. |
servername, server-name, sni |
sni |
Empty or whitespace-only names are absent; nonempty aliases must agree byte for byte. |
skip-cert-verify, skip_cert_verify, insecure |
skip_cert_verify |
Native booleans; supplied aliases must agree. |
fingerprint, pin-sha256, pin_sha256 |
tls_pin_sha256 |
Leaf-certificate SHA-256 pin in hex, with colons and whitespace ignored. It replaces PKI and hostname verification. All TLS protocols import Clash's fingerprint; a protocol without TLS skips the entry. Supplied aliases must agree. |
alpn |
tls_alpn |
Ordered string list (or comma-separated string) for raw-TCP TLS. XHTTP accepts only H2 and normalizes omission to ["h2"]. QUIC retains the protocol-specific rules below. |
ech-opts |
ech_enabled, ech_config |
Mapping with boolean enable, optional static Base64 config (omitted or empty enables DNS discovery), and query-server-name. Disabled or null blocks are ignored even on non-TLS protocols. Active enable: true rejects non-TLS protocols, unknown active subkeys, and discovery-only query-server-name (unsupported-subscription-entry; static config takes precedence over query-server-name), and rejects tls: false or malformed types/config (malformed-subscription-entry). |
disable-sni, disable_sni |
— | true skips the entry; false is accepted. |
Protocol-specific options
Supported spelling aliases normalize before node identity is derived.
| Protocol | Imported options |
|---|---|
| Hysteria2 | password/auth; obfs: salamander with obfs-password; upload/download bandwidth; ports/mport/port-hopping/port_hopping hopping ranges; hop-interval/mhop; receive windows; MTU and MTU-discovery settings. |
| TUIC | UUID/password, congestion control, ALPN, receive windows, MTU, and path MTU discovery. |
| Juicity | UUID/password, MTU, and path MTU discovery. |
| AnyTLS | idle-session-check-interval, idle-session-timeout, min-idle-session. |
| VMess | udp-over-tcp or udp_over_tcp: true or {enabled: true, version: 2} enables UoT v2. The version may be omitted or set to 0 or 2. Active packet-encoding, packet-address and multiplex wrappers reject the entry. |
Hysteria2, TUIC, and Juicity accept disable-mtu-discovery, disable_mtu_discovery, disable-path-mtu-discovery, disable_path_mtu_discovery, and disablePathMTUDiscovery. Set the option to true to disable path MTU discovery. Clash ignores null and requires all other supplied aliases to have matching boolean values. For other protocols, an active value rejects the entry with unsupported-subscription-entry. Inactive values such as false, null, 0, and "" are ignored.
Explicit disabled feature blocks are treated as disabled, not as unsupported active features. On VMess, udp: true alone keeps the TCP-only default. udp: false disables UDP even when UoT v2 is enabled. An explicit UDP restriction is rejected where the node model cannot preserve it.
With VMess UoT enabled, a nonzero alterId (alter_id or alter-id) or an active unknown UoT option skips the entry with unsupported-subscription-entry. A noninteger version, including "2", yields malformed-subscription-entry. With UoT off, Clash keeps TCP-only entries with a legacy alterId. The v2rayN JSON importer continues to ignore aid.
TUIC permits an absent or empty password. Hysteria2 and Juicity accept an explicit h3 ALPN matching their fixed runtime selection.
Hysteria2 port-hopping aliases are resolved in this order: ports, mport, port-hopping, then port_hopping. Null, empty or whitespace-only text, and empty arrays supply no claim. Supplied strings, finite numbers, or arrays normalize : range separators to - and compare by their canonical nonzero port set, so equivalent spellings such as ["4000:5000", 6000] and 6000,4000-5000 or adjacent ranges agree and retain the first non-absent alias's normalized spelling. Conflicting ranges or any invalid, empty-after-normalization, or duplicate-port alias reject the entry even beside a valid alias.
Juicity starts with 8 MiB stream and connection receive windows. Adaptive flow control can raise each of them up to 32 MiB. Imported initial-window fields accept absent values, 0, or 8388608. Other overrides are rejected.
AnyTLS packet claims are resolved once in this order: anytls-network, applicable network, then udp. Empty or null network text supplies no claim. Network strings use comma-separated tcp/udp tokens; aliases are compared by UDP allowance, so udp and tcp,udp agree, while tcp with udp: true conflicts. Unknown tokens such as quic reject the entry even beside a valid alias. Equivalent claims retain the first explicit network spelling; only a boolean-only input synthesizes tcp or tcp,udp.
TCP TLS ALPN rules apply to structured subscription imports and the flat tls_alpn field. Share-link ALPN compatibility is unchanged.
| Input or constraint | Behavior |
|---|---|
| List members | Preserve bytes and order. Each name occupies 1–255 UTF-8 bytes. |
| Length-prefixed list | At most 65,533 bytes. The complete ClientHello also has TLS-library size limits. |
Imported alpn absent, null, or empty |
Preserve existing TLS-profile defaults and node IDs. |
Flat tls_alpn |
Accept omission or a string array, not null. |
| Nonempty override | Participate in node identity. Reject with disabled TLS, REALITY, WebSocket, or gRPC instead of discarding it. |
| Chrome ALPS | Offer only when the actual ALPN list contains h2. |
XHTTP is the exception to the raw-TCP ALPN rule: it always uses H2, including REALITY and explicit cleartext H2. Mihomo accepts network: xhttp or the input alias splithttp.
xhttp-opts fields |
Import behavior |
|---|---|
path, host, mode, headers, x-padding-bytes, no-grpc-header, sc-max-each-post-bytes, sc-min-posts-interval-ms |
Accepted. |
no-sse-header, sc-max-buffered-posts, sc-stream-up-server-secs |
Server-only; type-checked and dropped. |
reuse-settings, xmux |
Follow the URI xmux rule with Xray's meaning. Mihomo instead enables its own reuse manager whenever reuse-settings is present. |
download-settings |
Must be an Xray StreamConfig mapping, as described below. |
download-settings accepts the panel-exported Xray shape: address, port, network, security, alpn, tlsSettings, and xhttpSettings. It may also contain flat x-padding-bytes, upload-only no-grpc-header/sc-* keys, and default reuse-settings/xmux. It has the same meaning as URI downloadSettings, so the two exports of one subscription produce the same node IDs.
A download-settings object that carries Mihomo's inheriting keys, such as server, servername, tls and skip-cert-verify, is rejected. This intentionally differs from mihomo, which ignores Xray-shaped keys and sends GETs to the upload server. See the XHTTP node reference for canonical defaults, bounds and header restrictions.
Other unsupported options, including alternate placements and padding-obfuscation settings, reject the entry on presence alone, even when null, empty or false. Other valid nodes in the same body are still imported. Extra JSON in a URI or VMess entry rejects duplicate members before map construction.
VLESS transport and REALITY
VLESS fields are applied before node identity is derived:
| Clash input | Mapping |
|---|---|
uuid, then password |
Credential; uuid wins and password is the fallback. |
encryption, then cipher |
VLESS Encryption; encryption wins. |
flow |
Empty or whitespace-only is absent; otherwise exactly xtls-rprx-vision or xtls-rprx-vision-udp443. |
network |
Stream transport. Packet permission remains the separate udp claim. |
reality-opts.public-key |
Enables the REALITY TLS carrier. It must be a non-empty string. |
reality-opts.short-id |
Optional REALITY short ID. |
reality-opts.spider-x |
REALITY spider path; missing or empty becomes /. |
ws-opts.path |
WebSocket path; falls back to flat ws-path. |
ws-opts.headers.Host |
WebSocket Host header: the first nonblank case-insensitive Host value wins; strings retain their bytes and finite numbers become text. Invalid or blank Host values are ignored. Falls back to scalar ws-headers, then ws-host, inspecting each only if no earlier value won. |
ws-opts.headers.<name> |
Additional WebSocket upgrade headers, shared by every WebSocket-capable proxy, imported as lowercase names (for example User-Agent). Null values are ignored and non-scalar values drop the entry; reserved handshake headers reject it per the node field contract. |
grpc-opts.grpc-service-name |
gRPC service name; falls back to grpc-service. |
client-fingerprint |
Intentionally not imported. TLS fingerprint selection is process-wide through global.tls_implementation and global.utls_imitate. |
Nested WS/gRPC values take precedence over their flat aliases. Active reality-opts must be a mapping with a non-empty public-key; an invalid active declaration is never downgraded to ordinary TLS. Empty or explicitly disabled feature blocks are ignored. Imported REALITY uses the same TLS-1.3-only, hybrid-then-classic key-share and fail-closed one-ClientHello behavior as a canonical share link; see the node reference.
VLESS UDP and multiplexing
Import defaults are source-specific. They do not all mean honk's canonical packetEncoding=auto default.
| Clash representation | Packet fallback | Multiplex | UDP permission |
|---|---|---|---|
| No packet declaration and no enabled wrapper | auto |
off | disabled |
| Only an empty/null packet encoding | auto |
off | disabled |
packet-encoding: none/legacy, or xudp: false |
native | off | enabled unless udp: false |
packet-encoding: xudp, or xudp: true |
Single XUDP | off | enabled unless udp: false |
udp: true without another packet declaration |
Single XUDP | off | enabled |
udp-over-tcp: true or enabled object with version 0/2 |
UoT v2 | off | enabled unless udp: false |
enabled smux/multiplex with protocol: h2mux or explicit padding |
auto (inactive while wrapped) | H2MUX | enabled unless udp: false |
mux: { enabled: true, ... } |
auto, unless an explicit packet encoding remains reachable through protocol fallback or skip |
Xray Mux.Cool | enabled unless udp: false |
Enabled H2MUX needs protocol: h2mux or an explicit padding. padding defaults to false, and true selects padded H2MUX. only-tcp: true, enabled Brutal, and nonzero max-connections, min-streams or max-streams reject the entry. Enabled H2MUX conflicts with Xray mux and UoT; enabled UoT also conflicts with Xray mux. Explicit XUDP conflicts with H2MUX or UoT, while their native/auto declarations are inactive behind the selected wrapper.
An enabled Clash mux block accepts active settings only for enabled, signed-i16 concurrency, signed-i16 xudpConcurrency, and xudpProxyUDP443. Inactive extras are ignored.
| Concurrency value | TCP concurrency |
xudpConcurrency |
|---|---|---|
| Negative | Disable TCP mux. | Use the packet fallback. |
| Zero | Allow 8 concurrent logical children per TCP carrier. | Share the enabled TCP pool and its per-carrier concurrency. If TCP mux is disabled, use the packet fallback. |
| Positive | Set per-carrier logical-child concurrency, capped at 128. | Create a separate UDP pool with this per-carrier logical-child concurrency, capped at 128. |
Concurrency never specifies a physical-carrier count. UDP/443 policy defaults to allow and also accepts skip or reject. See the node reference for precedence.
udp: false disables packet dialing independently. It does not disable an eligible bare TCP path. A VLESS Clash entry is also rejected for conflicting aliases, duplicate XUDP representations, enabled packet-address mode, unsupported packet encoding, unsupported UoT version, or an invalid/unsupported active Xray mux setting.
Canonical VLESS share links use exact packetEncoding=auto|none|xudp|uot-v2, mux=off|h2mux|xray, and udp=0|1 queries. The removed vless_mode query and ambiguous third-party share-link spellings such as smux, udp-over-tcp, and packet-encoding are rejected rather than guessed.
SIP008 and sing-box JSON or YAML
SIP008 and sing-box bodies may be JSON or the equivalent YAML. SIP008 {"servers":[...]} wrappers and bare server arrays import Shadowsocks server, server_port, method, password, and remarks. A wrapper version must be the integer 1 or 2. Empty plugin fields are harmless. Active plugins remain unsupported.
sing-box profiles import supported entries from outbounds:
- Proxy nodes: Shadowsocks, SOCKS5, VMess, VLESS, Trojan, Hysteria2, TUIC, Juicity, and AnyTLS.
- Structural entries, not proxy nodes:
selector,urltest,direct,block, anddns.
TLS/SNI, REALITY, WebSocket/gRPC (including non-Host upgrade headers), VLESS packet choices, and supported protocol tuning normalize through the common node builder.
sing-box TLS is off when tls or tls.enabled is absent, so Trojan, Hysteria2, TUIC, Juicity and AnyTLS entries without tls.enabled: true are skipped.
| Source-specific case | Import behavior |
|---|---|
WebSocket transport.headers |
Host remains a dedicated string field; repeated Host aliases reject. Other string values, including empty strings, are preserved; null is ignored and other types reject the entry. Names and values follow the node header contract. |
VMess udp_over_tcp |
honk accepts this extension in sing-box-shaped entries. true or an object with enabled: true enables UoT v2. The only accepted explicit version is 2, also the default. network: tcp disables UDP. The sing-box 1.12 VMess inbound supports UoT v2. The official 1.12 VMess outbound schema omits this field. |
VLESS without an enabled H2MUX/UoT wrapper or explicit packet_encoding selecting another path |
Single XUDP with UDP permitted. This is a sing-box import default, not the global meaning of Auto. |
| Empty or omitted gRPC service name | Retain sing-box's empty service, not honk's GunService default. |
Hysteria2 server_ports without server_port |
Use the first hopping port as the nominal endpoint. |
Hysteria2, TUIC, or Juicity disable_path_mtu_discovery / disable_mtu_discovery |
Optional; when present, supply one boolean key. true disables path MTU discovery. Supplying both keys, even with equal values, or a non-boolean value such as null skips the entry. |
tls.ech |
Object with boolean enabled, optional config (single -----BEGIN ECH CONFIGS----- PEM string or line array; omitted or empty enables DNS discovery), config_path, and query_server_name. Inactive blocks (enabled absent, null, or false) are ignored. tls.enabled: false with active ech.enabled: true, active config_path, discovery-only query_server_name (static config takes precedence), non-ECH CONFIGS / multi-block / header-bearing / trailing-garbage PEM, invalid Base64/RFC 9849 payloads, and unknown active ECH subfields skip the entry with malformed-subscription-entry. |
| Per-node uTLS fingerprint hint | Does not override honk's process-wide TLS selection. |
Unsupported chaining, wire features, and authentication requirements are not silently discarded.
In sing-box input, network is packet capability, not a stream type. transport.type selects the stream. Unsupported stream names such as h2 reject the entry rather than becoming raw TCP.
Official sing-box has no native XHTTP transport. This importer explicitly rejects transport.type: xhttp and splithttp. It does not reinterpret old http, H2, QUIC or a third-party fork as XHTTP. Client-record XHTTP transports are likewise unsupported.
Where the sing-box mapping supports packet restrictions, network: udp and network: tcp,udp permit UDP, while network: tcp disables it. These values do not introduce UDP-only TCP rejection. network remains independent of VLESS fallback encoding and H2MUX/UoT carrier selection.
Explicit sing-box native VLESS UDP (packet_encoding: "") maps to native. Enabled H2MUX or UoT v2 owns the packet path even when the source also specifies packet_encoding, including "xudp". Disabling a wrapper does not suppress the sing-box Single-XUDP default. Sing-box multiplex import remains H2MUX-only. It does not synthesize Xray Mux.Cool controls.
Surge, Surfboard, Loon, and Quantumult X
The importer accepts named comma-separated records from Surge/Surfboard/Loon and protocol=endpoint,...,tag=name records from Quantumult X. Full profiles use [Proxy] or [server_local]. Other sections are ignored. Quoted names/passwords may contain commas, equals signs, escaped quotes, and intentional edge spaces.
Explicit credential and cipher aliases must agree before conversion. In named records, positional credentials are used only when the corresponding named claim is absent. A different positional value does not conflict with a valid explicit claim. Quantumult X has no positional fallback. Empty explicit credentials participate in alias comparison rather than selecting a fallback.
Permitted optional record credentials retain empty strings and quoted whitespace byte for byte: SOCKS username/password, Hysteria2 authentication, and TUIC password. An explicit empty value still overrides a positional fallback. Protocols requiring nonempty credentials continue to reject it.
Records for hysteria2, tuic, and juicity accept the five Clash MTU discovery aliases. Names and values are case-insensitive. 1, true, yes, and on disable discovery. 0, false, no, and off leave it enabled. honk skips the record if any value is empty or invalid, or if repeated values disagree after conversion.
Record transport/network stream claims are compared before assignment, including repeated keys. Empty text and tcp have the same raw-TCP meaning. Conflicting or unsupported stream claims reject the entry.
AnyTLS record network occurrences are packet claims, not stream claims. Every repeated network, udp, and udp-relay value is validated before selection. Equivalent packet claims retain the first explicit network spelling. An invalid or conflicting occurrence rejects the record.
VLESS record packet-encoding/packet_encoding/packetencoding values none or empty select native UDP. xudp selects Single XUDP. Repeated aliases must agree, including explicit empty assignments. udp/udp-relay controls packet permission separately. With neither a packet encoding nor udp: true, a record remains UDP-disabled. udp: true without an encoding selects Single XUDP. Active record mux and UoT declarations remain unsupported rather than being reinterpreted.
Supported records map credentials, TLS/SNI, WebSocket/gRPC, REALITY, and implemented protocol options to the same node model. Quantumult X obfs=wss uses obfs-host for both WebSocket Host and the default TLS SNI. An explicit TLS hostname wins. SSR, unsupported plugins/obfuscation, and unsupported transports are skipped rather than imported as another protocol.
Surge server-cert-fingerprint-sha256 maps to honk's leaf-certificate pin: both replace standard X.509 verification. Independent server-cert-verify-name, client certificates, sni=off, and Shadow TLS are not representable and are rejected rather than discarded (Surge TLS reference).
Record aliases skip-cert-verify, allow-insecure, and insecure are compared with the inverse of tls-verification before assignment. tls-verification=false,insecure=true agrees; tls-verification=true,insecure=true rejects the entry. Record text accepts true/yes/1/on and false/no/0/off, case-insensitively. Empty text and t/y/f/n remain invalid. Certificate-pin restrictions still apply.
Effective Quantumult X tls-cert-sha256 and tls-pubkey-sha256 pins are rejected. honk's leaf-certificate pin replaces PKI, and honk does not substitute it for an external verification contract that is not confirmed equivalent. With explicit tls-verification=false, QX ignores both pins, and the import preserves that disabled verification. Effective QX REALITY ignores customized tls-alpn and session-ticket settings, as its official configuration specifies. Ordinary TLS does not ignore them. Legacy VMess aead=false, active Shadowsocks UoT/SSR, unsupported TLS ALPN, and disabled TLS-session reuse are rejected rather than discarded. Client records do not support ECH; active ECH options continue to reject the record.
Offline parsing and probes
honk-tool sub accepts a fetched subscription URL or a local file in any supported body format. A local file avoids the subscription download and is useful for offline parsing, but the command then performs its configured connectivity and latency probes:
honk-tool sub ./share-links.txt --limit 10
honk-tool sub https://example.com/sub --ua honk-tool
Downloaded bodies and local files use the same automatic detection. Passing - reads one HTTP(S) subscription URL from standard input. It does not read a subscription body from standard input. See the CLI reference for probe flags and output.