Request headers
What RainClash sends when it fetches a subscription, how it picks a client identity, and how it handles redirects, statuses and fallback hosts.
On this page
Client headers
| Header | Value |
|---|---|
User-Agent | Set by the client preset. |
Accept-Encoding | gzip, deflate |
Authorization | Basic, built from the subscription URL's userinfo. |
x-hwid | Device ID, only when enabled. |
x-client, x-app-version, x-device-locale, Accept-Language | Only under the Happ and INCY presets. |
Client presets
The profile's "Request as" setting picks the preset. New profiles use Automatically; profiles created before the setting existed use RainClash.
| Preset | User-Agent | Extra headers |
|---|---|---|
| RainClash | RainClash/v<version> clash-verge Platform/<os> | — |
| FlClashX | FlClash X/v0.4.2 core/v1.19.28 Platform/<os> | — |
| Clash Meta | ClashMetaForAndroid/2.11.36.Meta | — |
| Clash | ClashForAndroid/2.5.12 | — |
| Happ | Happ/4.7.1/<Platform>/17912103176801703650 | x-device-locale: <language> |
| INCY | INCY/3.3.1 | x-client: INCY, x-app-version: 3.3.1, x-device-locale: <locale>, Accept-Language: <locale> |
| sing-box / Karing | Karing/1.2.25.2802 | — |
| v2rayNG | v2rayNG/2.3.11 | — |
| Custom User-Agent | User text, at most 512 characters, no control characters | — |
<os> is android, windows, macos or linux. The app-wide User-Agent setting can replace the RainClash value.
Automatic negotiation
Automatically tries the last successful preset first, then the table order from RainClash to v2rayNG. Presets that would send identical headers are skipped. At most 8 attempts run within 20 seconds.
The next preset is tried only on 406, 415 or an unknown body format. Any other failure stops negotiation.
A preset changes only request headers, never the device ID.
Redirects and transport
Up to 5 redirects. Each response carries exactly one
Location. Loops andhttpstohttpfail.A redirect to another origin keeps only
User-Agent,AcceptandAccept-Language. The device ID and authorization are dropped.Content-Encodingmust begzip,deflateoridentity, sent once. Gzip and zlib bodies are also detected by magic bytes.The body may be 16 MiB on the wire and 32 MiB decoded. An empty body fails.
Content-Typeis not checked.
Response formats
RainClash detects the body format locally. Native Clash YAML is kept as-is; share-link lists, Xray JSON (one configuration or an array), sing-box JSON, WireGuard and supported Amnezia containers are converted to Clash YAML before Core validation.
Share-link lists accept plain text, Base64 and Base64url. Supported schemes include mierus, tt (TrustTunnel), socks5h, hysteria2+realm and hy2+realm; Mieru links can define several port/protocol pairs. A TrustTunnel link that sets anti-DPI, a client random prefix or several addresses imports with a loss warning, because the Core cannot express those fields. Unrecognized or malformed node links in a recognized list are reported as skipped.
VLESS XHTTP conversion preserves supported extra options, including headers, padding, connection reuse and a separate download connection. Unsupported or malformed extra options are reported as conversion losses. Xray 26 security fields are carried through: REALITY publicKey and its password alias, mldsa65Verify, TLS certificate pins, verifyPeerCertByName, ECH, finalmask, per-server fragments, VLESS encryption, VMess KCP, and XHTTP session parameters. spiderX, Incy routing/metadata directives, mux on non-VLESS outbounds, and foreign DNS or inbound sections that mihomo cannot express are reported as conversion losses. Xray mux on VLESS becomes mux.cool. Xray raises a TCP concurrency below 128 to 128, and the importer preserves that effective value; a negative value disables mux. A Vision outbound keeps its mux only when TCP muxing is disabled (concurrency: 0 or absent) and XUDP is enabled (xudpConcurrency > 0): the importer emits the Core's concurrency: 0 (no TCP pool), so TCP stays plain Vision and only UDP is multiplexed. Other Vision mux is a conversion loss. A block with neither a TCP pool nor XUDP is dropped. routing is converted only for the rules mihomo can represent. Unusable security fields, such as a REALITY key or short id, an ECH config, or a VLESS encryption string the Core rejects, skip the node as a security loss instead of falling back to plain TLS. sing-box detour becomes dialer-proxy; ECH and multiplex become ech-opts and smux, and rules or TLS fields the Core cannot express are reported as losses. Every proxy is built through the Core parser before an import is saved, so a node the Core cannot construct is rejected instead of becoming a profile with no proxies. Losses require approval or an already accepted import policy for that source; an unapproved update leaves the saved profile unchanged.
Xray freedom outbounds with fragment settings or stream sockopt become a freedom proxy node, preserving those fields and using dialer-proxy for an outbound that names it. A bare freedom outbound stays the built-in DIRECT, because it has no settings to preserve.
Xray Hysteria outbounds (protocol: "hysteria", version 2) become mihomo hysteria2. TLS SNI, ALPN, certificate pinning and brutal up/down rates are kept; unsupported QUIC or TLS fields are reported as losses. Xray's VMess security: "none" becomes auto, matching Xray's own fallback instead of sending an unknown security type.
Xray MASQUE outbounds (protocol: "masque", transport masque) import both WARP and standard server-assigned forms. masqueSettings.warp keys and addresses become private-key, public-key, ip and ipv6, including PKCS#8 or SEC1 private keys and PEM public keys. Without warp, the Core performs RFC 9484 CONNECT-IP over h3 or Extended CONNECT h2, sends ADDRESS_REQUEST for IPv4 and IPv6, uses the addresses assigned by the server, percent-encodes wildcard target/ipproto values as %2A, and requires the server's Capsule-Protocol response; host, path, remoteDNS, TLS SNI, request headers, user/pass as Basic authentication, h2 ALPN and supported QUIC congestion fields are preserved. Certificate pins, ECH, client certificates, TLS trust-root/version/cipher policy changes and unsupported ALPN values that the Core cannot enforce still skip the node instead of weakening verification. Xray WireGuard imports keep all peers, preSharedKey, keepAlive, remoteDNS, base64 reserved, and convert hex keys to the base64 form mihomo expects. Flat Xray HTTP/SOCKS endpoints and the method transport alias are accepted as well. Hiddify-style masque:// links are imported when they carry both the device private key and the peer public key; a link without the peer key is skipped instead of accepting an unverifiable endpoint.
Response status
| Response | Result |
|---|---|
x-hwid-max-devices-reached: 1 with any status | Device-limit failure. The error offers support-url from the same response, if it is an http(s) link. |
401, 403 | Unauthorized. |
429 | Rate-limited. |
406, 415 | Fails; Automatically tries the next preset. |
Other non-2xx | Fails. |
2xx with an empty body, or no nodes, groups or remote providers | Fails. |
2xx in an unknown format | Fails; Automatically tries the next preset. |
A failed update leaves the saved profile, its metadata and its manifest unchanged.
Fallback hosts
Both fields work only for https subscriptions. The path and query are kept; only host[:port] changes.
| Manifest key | Value | Behavior |
|---|---|---|
transport.fallback-hosts | Up to 5 host[:port] | Tried in order after a transport, TLS, timeout, rate-limit or invalid-response error on the main host. Never replaces the stored URL. |
transport.new-domain | One host[:port] | Tried first. After a successful update, the new host is fetched and validated; the profile moves to it only if that succeeds. Failure is ignored. |
Fallbacks come from the stored manifest, so an earlier successful update must deliver it. Requests to them carry the same headers as to the main host, including the device ID.
transport:
fallback-hosts: [sub2.example.net, sub3.example.org:8443]
new-domain: sub.example.comDevice ID
Values
| Header | Value |
|---|---|
x-hwid | First 32 lowercase hex characters of SHA-256 over RainClash/HWID/v1\0 and a platform ID. |
x-device-os, x-ver-os, x-device-model | OS name, OS version and device model. All three headers are sent with x-hwid; values the platform does not report are empty. |
The platform ID is ANDROID_ID on Android, MachineGuid on Windows, the system GUID on macOS and /etc/machine-id on Linux. A random value is used when none exists. The ID is stored per device, is the same for every profile, and is excluded from backups. It is a pseudonymous identifier, not hardware attestation.
Consent
"Send HWID" has a global value and a per-profile override; "Use global" follows the global value.
Turning it on shows a disclosure.
The ID goes only to the subscription URL's origin and its fallback hosts. A cross-origin redirect drops it, and a manifest on another origin never receives it.
Preview API and logo requests never carry it.
Device status
| Header | Value | Effect |
|---|---|---|
x-hwid-max-devices-reached | 1, true or yes | The update fails with a device-limit error (Response status). |
x-hwid-not-supported | 1, true or yes | Shown as "Device status" in the Subscription inspector. |
A flag counts only when its header is sent once. When both are set, the device limit wins.