Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clash Rulesets

This repository stores service-specific Clash rule providers and generates two aggregate providers:

  • The auto branch contains the generated providers.
  • lowlatency.yaml contains application and service traffic that should use lowlatency.
  • generic.yaml contains explicitly classified generic application traffic.

The aggregate files are regenerated by GitHub Actions after every push to master and published only to the auto branch. The generated files are not stored on master.

python3 scripts/generate_rulesets.py --output-dir ./build

Native Providers

The original service providers can be used directly without the generated files:

rule-providers:
  cloudflare:
    type: http
    behavior: domain
    url: "https://raw.githubusercontent.com/RedCokeDevelopment/clash-ruleset/master/services/cloudflare.yaml"
    path: ./ruleset/cloudflare.yaml
    interval: 86400

  discord:
    type: http
    behavior: classical
    url: "https://raw.githubusercontent.com/RedCokeDevelopment/clash-ruleset/master/services/discord.yaml"
    path: ./ruleset/discord.yaml
    interval: 86400

  escapefromtarkov:
    type: http
    behavior: classical
    url: "https://raw.githubusercontent.com/RedCokeDevelopment/clash-ruleset/master/services/escapefromtarkov.yaml"
    path: ./ruleset/escapefromtarkov.yaml
    interval: 86400

  battle-eye:
    type: http
    behavior: classical
    url: "https://raw.githubusercontent.com/RedCokeDevelopment/clash-ruleset/master/services/battle_eye.yaml"
    path: ./ruleset/battle_eye.yaml
    interval: 86400

  google:
    type: http
    behavior: domain
    url: "https://raw.githubusercontent.com/RedCokeDevelopment/clash-ruleset/master/services/google.yaml"
    path: ./ruleset/google.yaml
    interval: 86400

Use the native providers directly in your rules:

rules:
  - RULE-SET,cloudflare,lowlatency
  - RULE-SET,discord,lowlatency
  - RULE-SET,escapefromtarkov,lowlatency
  - RULE-SET,battle-eye,lowlatency
  - RULE-SET,google,lowlatency

Generated Providers

This repository automatically generates two aggregate providers, lowlatency and generic, from the individual service providers. The generated providers are available in the auto branch, and can be used in your Clash config. Add these providers to your Clash config:

rule-providers:
  lowlatency-applications:
    type: http
    behavior: classical
    url: "https://raw.githubusercontent.com/RedCokeDevelopment/clash-ruleset/auto/lowlatency.yaml"
    path: ./ruleset/lowlatency-applications.yaml
    interval: 86400

  generic-applications:
    type: http
    behavior: classical
    url: "https://raw.githubusercontent.com/RedCokeDevelopment/clash-ruleset/auto/generic.yaml"
    path: ./ruleset/generic-applications.yaml
    interval: 86400

Use the providers in this order. The low-latency application rules must come first. Keep the normal traffic fallback as a regular rule in the main config:

rules:
  - RULE-SET,lowlatency-applications,lowlatency
  - GEOSITE,cn,DIRECT
  - GEOIP,CN,DIRECT
  - RULE-SET,generic-applications,large-bandwidth
  - MATCH,large-bandwidth

GEOSITE rules cannot be stored in a rule provider and must remain in the main Clash config. Put them after the application-specific rules when they should not override those rules.

Service Providers

The original service providers remain available individually under services/. Their membership in the aggregate providers is controlled by config/rulesets.yaml. Add a service path under lowlatency to include it in the generated low-latency provider.

About

RedTea's Clash ruleset configuration

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages