Proxy Providers¶
name¶
Required. For example, provider1. It must be unique and it is recommended not to duplicate names with Proxy Groups.
type¶
Required. The type of the provider. Available options: http / file / inline.
url¶
Required if the type is set to http.
path¶
Optional. The file path. It must be unique. If left empty, the MD5 hash of the URL will be used as the filename.
Due to security concerns, this path is restricted to the HomeDir (configured via the -d startup parameter) by default. If you wish to store it in another location, please specify additional safe paths by setting the SAFE_PATHS environment variable. The syntax of this environment variable follows the parsing rules of the host operating system's PATH variable (i.e., separated by semicolons on Windows, and by colons on other operating systems).
interval¶
The update interval for the provider, in seconds.
proxy¶
Downloads/updates through the specified proxy.
size-limit¶
Limits the maximum size of the downloaded file. Default is 0, which means no file size limit. The unit is bytes (b).
age-secret-key¶
If configured, the core will attempt to decrypt the age armor-formatted configuration file using this secret key.
Note:
- For encrypted content, only the official ASCII "armor" format of age-encryption.org/v1 is currently supported.
- For the key format, only the x25519 recipient type of age-encryption.org/v1 and The mlkem768-x25519 hybrid post-quantum recipient type are currently supported.
- Currently, the core will not actively send the public key to the server. Users need to manually set the
X-Age-Public-Keyin the header or upload the public key via other methods. - The core also supports loading encrypted configuration files via the
-age-secret-keycommand-line parameter or theCLASH_AGE_SECRET_KEYenvironment variable.
Utilities:
- You can generate a compliant x25519 key via
mihomo age keygen. - You can generate a compliant mlkem768-x25519 key via
mihomo age keygen-pq. - You can export the age-public-key from an age-secret-key via
mihomo age convert <secret_key>. - You can decrypt an encrypted file via
mihomo age decrypt <secret_key> <source_file> <target_file>. When<source_file>is-, it will read from standard input; when<target_file>is-, it will write to standard output. - You can encrypt an unencrypted file via
mihomo age encrypt <public_key> <source_file> <target_file>. When<source_file>is-, it will read from standard input; when<target_file>is-, it will write to standard output.
Reference Implementations:
- Golang: FiloSottile/age
- Rust: str4d/rage
- Typescript: FiloSottile/typage
header¶
Custom HTTP request headers.
health-check¶
Health Check (Latency Test)
health-check.enable¶
Specifies whether to enable it. Available options: true/false.
health-check.url¶
The health check URL. It is recommended to use one of the following addresses:
health-check.interval¶
The interval time for health checks, in seconds.
health-check.timeout¶
The timeout duration for health checks, in milliseconds.
health-check.lazy¶
Lazy state. Default is true. When the nodes in this provider are not in use, health checks will not be performed.
health-check.expected-status¶
See Expected Status.
override¶
Overrides the configuration of nodes when they are loaded. Supported fields are listed below:
override.additional-prefix¶
Adds a fixed prefix to the node names.
override.additional-suffix¶
Adds a fixed suffix to the node names.
override.proxy-name¶
Replaces content in node names, supporting regular expressions. pattern represents the content to be replaced, and target represents the replacement target.
override.Other Configurations¶
Refer to common fields tfo
Refer to common fields mptcp
Refer to common fields udp.
Refer to Shadowsocks udp-over-tcp
Refer to Hysteria/Hysteria2 up.
Refer to Hysteria/Hysteria2 down.
Refer to common fields skip-cert-verify.
Refer to common fields name-cert-verify.
Refer to common fields dialer-proxy.
Refer to common fields interface-name.
Refer to common fields routing-mark.
Refer to common fields ip-version.
override.override-expr¶
This is a yq v4 style subset for expression-based configuration overrides. The array items are executed sequentially and take effect after the fixed-field overrides mentioned above (such as udp: true, etc.).
Supported path forms include ., .name, ."a.b", .["a.b"], .items[0], and .items[-1]; [] can traverse arrays or mappings. Assignment creates missing mappings and non-negative array indexes, but does not update through scalars.
Supported operations include =, |=, +=, -=, *=, del(.field), pipeline |, comma union, select, the // default operator, common comparisons, and boolean operations. Values support null / ~, booleans, decimal/hex integers, floats, double-quoted strings, arrays, and mappings with double-quoted keys.
Supported functions include length, keys, has, contains, select, reverse, sort, unique, flatten, any, all, map, map_values, filter, to_entries, from_entries, with_entries, any_c, all_c, test, sub, split, join, upcase, downcase, trim, tostring, tonumber, type, and not.
Limitations & Notes
- Each item must ultimately produce exactly one mapping. Uncollected multiple results and
del(.)are not supported. - Parentheses are mandatory when using pipelines (
|) orand/oron the right side of an assignment. from_entriesonly accepts an entries array with string keys.sortonly supports arrays of scalars.any/allonly support their parameterless forms.==/!=compare the scalar textual value as peryqrules, rather than performing structural comparisons on arrays or mappings.<,<=,>,>=only support numbers, strings, andnull. Onlyfalseandnullare treated as falsy values.- Standard function arguments must not yield multiple results; however, functions that receive expressions (such as
map/filter) allow their arguments to yield result streams. - Function arguments can be separated by commas or semicolons.
- Evaluation follows value semantics. Out-of-bounds reads do not extend the source array, and
flatten/map_valueson the right side do not implicitly modify the source path. - Use
|=when you need to modify the source path. If there is no result on the right side, the target retains its original value instead of automatically creatingnull. - Mapping streams,
keys, and entries transformations are sorted by key, asmap[string]anydoes not preserve the original YAML key order. - Unsupported language features: Variables (
as/$x),reduce, dynamic paths (.[$key]), recursive descent (..). - Unsupported external features: Multi-documents, file/environment access, YAML tag/style/comment handling,
yqCLI arguments. - Any
yqsyntax, operators, or functions not explicitly listed above are also unsupported. Conditional branching can be achieved usingselectfollowed by multiple chained assignments.
filter¶
Filters nodes that match keywords or regular expressions. Use | to separate multiple regular expressions.
exclude-filter¶
Excludes nodes that match keywords or regular expressions. Use | to separate multiple regular expressions.
exclude-type¶
Does not support regular expressions. Separated by |. Excludes nodes based on their proxy type.
The exclude-type of the provider uses the type field defined within the configuration file to perform the exclusion.
payload¶
Content. Only takes effect when type is set to inline.
When http or file parsing fails, the payload can also be used as a fallback backup proxy list.