Clash for Windows takes into account Profiles (Subscription) updates and custom rules.

Edit the "Parsers" field:

Fill in the following configuration (YAML syntax):

  - url:
    code: |
      module.exports.parse = (raw, { yaml }) => {
        const { rules = [], } = yaml.parse(raw) || {}
        const removeList = [
        const addList = [

        const newRules = rules.filter(x => !removeList.includes(x))

        return yaml.stringify({, rules: newRules })

Then make the following modifications to the above configuration:

  1. Change the value of the url configuration to your own subscription address.
  2. Fill in the array of rules to be removed in the removeList, and fill in the array of rules to be added in the addList. For rule syntax, please refer to: Rule Editing | Clash for Windows ( Common matching rules include:
    Assuming the domain to be proxied is "":
    • DOMAIN-SUFFIX: Domain suffix matching, for example: it will proxy requests for "" and all domains under "*", i.e., all domains with a suffix of "".
    • DOMAIN: Domain matching, for example: only proxy requests under the specified domain "".
    • "DOMAIN,,DIRECT" means proxy requests for the specified domain "", and requests that match the rule will use the DIRECT strategy, which means direct connection without going through the proxy. "DIRECT" and "REJECT" are built-in policies in Clash for Windows, while others are custom policies. The names of "proxy-groups" configured by the subscription and the airport owner may vary, depending on the configuration of "proxy-groups" in your subscription, and "proxy-groups" will group the values of the "proxies" field.
    • "DOMAIN-SUFFIX,,KELECLOUD" means proxy requests for the domain "" and "*", and requests that match the rule will use the "KELECLOUD" strategy (a custom strategy defined by the airport owner), and the value of this strategy is taken from the "proxy-groups" field in the subscription content.
  3. Update the subscription, because the js code rules configured in parsers will only be executed after each subscription update.

After configuring, you can test whether the rules meet expectations by searching for the IP keyword on Baidu. The IP query module of Baidu calls the interface domain suffix "" in the example above:


Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.