Skip to content

zhanyeye/clash-rules-lite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 

Repository files navigation

GitHub Readme Stats

Clash Rules Lite

🍒 自定义代理规则,精简匹配规则(内容健康),适合学生和开发者使用。

https://cdn.jsdelivr.net/gh/zhanyeye/clash-rules-lite@release/rules.txt

代理规则列表

使用方法

  1. 拷贝一份订阅脚本到 local file
  1. local file 脚本中,修改配置如下,保留你的 proxiesproxy-groups
mixed-port: 7890
allow-lan: true
bind-address: '*'
mode: rule
log-level: silent
external-controller: '127.0.0.1:9090'
proxies:
    - { name: '1-香港', type: *, server: **, port: *, cipher: **, password: **, udp: true }
    - { name: '2-香港', type: *, server: **, port: *, cipher: **, password: **, udp: true }
proxy-groups:
    - { name: 'PROXY', type: select, proxies: ['1-香港', '2-香港'] }
rules:
  - DOMAIN-KEYWORD,github,PROXY
  - DOMAIN-KEYWORD,google,PROXY
  - RULE-SET,pac,PROXY
rule-providers:
  pac:
    type: http
    behavior: domain
    url: "https://cdn.jsdelivr.net/gh/zhanyeye/clash-rules-lite@release/rules.txt"
    path: ./rules/pac.yaml
    interval: 86400
script:
  code: |
    def main(ctx, metadata):
        keywords = ["google", "github"]
        for key in keywords:
            if key in metadata["host"]:
                return "PROXY"
        if ctx.rule_providers["pac"].match(metadata):
            return "PROXY"
        else:
            return "DIRECT"

  1. 运行修改后的 local file,再切换成 RuleScript 模式。

如何自定义

fork 该仓库,修改rules.txt,github actions 会自动生成,记得将url中的用户名替换成自己的。