1
SuzutsukiKaede 252 天前 1
自己写规则,用 DNS 分流
|
2
Mickeyy 252 天前 1
|
3
sentinelK 252 天前 1
翻译:
clash 订阅的 proxy 策略,和楼主的需求不匹配,应该怎么调整。 |
4
sharezt 252 天前 1
这就是我在另一个帖子里提到的:
我们用 zero trust ,简单粗暴: 1. 缺省流量走国外,反正免费; 2. 国内 IP 段走本地; 3. 私有 DNS 防污染,能够返回国内就近 CDN ,能够打开腾讯电影; 4. 再也不用针对不同的应用定义域名和 IP 分流规则; 正在验证是否比 clash 稳定... |
6
sharezt 252 天前
|
7
totoro625 252 天前 1
Q:除了编辑 yaml 文件一个个加之外有其他好办法吗
A:订阅别人写好的规则,或者使用 GEOIP 规则 Q:还是说是我用的机场给的配置文件太烂导致这么多漏网 A:是的 别人的规则是针对小白使用的,你有专业话的需求,肯定得自己写规则 example: - RULE-SET,国外优先域名,Proxies,no-resolve - RULE-SET,国内优先域名,CNSelect,no-resolve - RULE-SET,国外域名列表,Proxies,no-resolve - RULE-SET,国内域名列表,CNSelect,no-resolve - RULE-SET,关键词匹配,Proxies,no-resolve - RULE-SET,境外 IP 规则,Proxies - RULE-SET,内网 IP 规则,CNSelect - GEOIP,CN,CNSelect - IP-CIDR,0.0.0.0/32,REJECT - MATCH,Proxies |
8
gaobh 252 天前 via iPhone 1
加一个自己搞的远程规则,用 github 就行,日常之在 github 上编辑维护列表就行
|
9
pkoukk 252 天前 1
|
11
leconio 252 天前 1
xray 可以自己写,用 geosite 或者 geoip 。https://github.com/v2fly/domain-list-community
|
12
f0rger 252 天前 via iPhone 1
在漏网之前添加 cn 的 ip 和 domain ,实在不放心还有 geosite 。可以处理绝大部分的 cn 站点
|
14
MadeInHaven 252 天前 1
找一个比较流行的订阅,然后照着改自己的
|
15
ByteCat 252 天前 1
|
16
peterli427 251 天前 1
给你写了个配置文件参考,https://github.com/PeterHgg/clash-profile-example/blob/master/test.yml
机场链接按说明填入 下面的分流规则是源自项目: https://github.com/Loyalsoldier/clash-rules 我只给你写了两个,一个代理链接,一个直连链接,都是从上面的项目获取的 把 rule provider (在线获取分流规则)任选一个复制一份,修改名字和规则链接 然后修改下面的 rules 分流规则,就是让上面的规则,走什么节点,比如直连规则走 direct 直连,代理规则走上面机场测速出来的最快的节点 |
17
peterli427 251 天前 1
@peterli427 #16 你也可以直接用,看看还有没有国内走代理的问题,有需求再去在线规则找你要的链接,添加一个规则
|
18
chengxy 251 天前 1
可以自己写配置,然后用订阅转换成订阅连接。
这是我自己弄的,https://raw.githubusercontent.com/MsRem/Config/main/Clash/Config.ini ,你可以参考一下。 |
19
guzzhao 251 天前 1
我用的是 clash verge 的脚本
``` const mainSelect = "🚀 节点选择" const autoSelect = "🎃 自动选择" const otherSelect = "🐟 漏网之鱼" const githubProxyUrl = "https://ghproxy.net/https://raw.githubusercontent.com/" const myProxyUrlList = [ 'npmmirror.com' ] const myDirectUrlList = [ ] function main(params) { initDns(params) initGroups(params) initRules(params) delParams(params) // 自定义 microsoftRules(params) myRules(params) return params; } function initGroups(params) { const proxies = params["proxies"].map(e => e.name) const groupFilter = { "🇭🇰 香港 自动选择": "港|HK|Hong", "🇯🇵 日本 自动选择": "日|东京|JP|Japan", "🇸🇬 新加坡 自动选择": "新|坡|獅|SG|Singapore" } let auto = Object.keys(groupFilter).map(gf => { return { name: gf, type: 'url-test', url: 'https://cp.cloudflare.com/generate_204', tolerance: 20, proxies: proxies.filter(p => new RegExp(groupFilter[gf]).test(p)) } }).filter(e => e.proxies.length > 0) const proxyGroups = [ { name: mainSelect, type: 'select', proxies: [autoSelect, ...auto.map(e => e.name), ...proxies] }, { name: otherSelect, type: 'select', proxies: [mainSelect, 'DIRECT'] }, { name: autoSelect, type: 'url-test', url: 'https://cp.cloudflare.com/generate_204', tolerance: 20, proxies: proxies }, ...auto ] params["proxy-groups"] = proxyGroups } function initRules(params) { let baseUrl = githubProxyUrl + "Loyalsoldier/clash-rules/release/"; let ruleProvidersKeys = [ 'reject', 'icloud', 'apple', // 'google', 'proxy', 'direct', 'private', // 'gfw', proxy 包含 gfw 'tld-not-cn', // 'telegramcidr', 'cncidr', 'lancidr', 'applications'] let ruleProviders = {} ruleProvidersKeys.forEach(e => { ruleProviders[e] = { type: "http", behavior: "domain", url: baseUrl + `${e}.txt`, path: `./ruleset/${e}.yaml`, interval: 86400 } }) let rules = [ "RULE-SET,applications,DIRECT", "DOMAIN,clash.razord.top,DIRECT", "DOMAIN,yacd.haishan.me,DIRECT", "RULE-SET,private,DIRECT", "RULE-SET,reject,REJECT", // 广告域名列表 "RULE-SET,icloud,DIRECT", "RULE-SET,apple,DIRECT", // "RULE-SET,google," + mainSelect, Google 在中国大陆可直连的域名列表 "RULE-SET,direct,DIRECT", "RULE-SET,lancidr,DIRECT", "RULE-SET,cncidr,DIRECT", // "RULE-SET,telegramcidr," + mainSelect, "RULE-SET,proxy," + mainSelect, "GEOIP,CN,DIRECT,no-resolve", "MATCH," + otherSelect ] params["rule-providers"] = ruleProviders params["rules"] = rules } function initDns(params) { params["dns"] = { "enable": true, "ipv6": false, "listen": "0.0.0.0:1053", "default-nameserver": [ "223.5.5.5", "119.29.29.29", "114.114.114.114" ], "enhanced-mode": "fake-ip", "fake-ip-range": "28.0.0.1/8", "use-hosts": true, "nameserver": [ "tls://223.5.5.5:853", "tls://223.6.6.6:853", "https://doh.pub/dns-query", "https://dns.alidns.com/dns-query" ], "fallback": [ "https://doh.dns.sb/dns-query", "https://dns.cloudflare.com/dns-query", "https://dns.twnic.tw/dns-query", "tls://8.8.4.4:853" ], "fallback-filter": { "geoip": true, "ipcidr": [ "240.0.0.0/4", "0.0.0.0/32" ] } } } function delParams(params) { delete params["cfw-conn-break-strategy"] delete params["experimental"] delete params["hosts"] delete params["cfw-latency-timeout"] delete params["cfw-latency-url"] delete params["clash-for-android"] delete params["udp"] } function microsoftRules(params) { let baseUrl = githubProxyUrl + "blackmatrix7/ios_rule_script/master/rule/Clash/"; let microsoftProviders = { 'microsoft': { type: "http", behavior: "classical", url: baseUrl + "Microsoft/Microsoft.yaml", path: `./ruleset/microsoft.yaml`, interval: 86400 }, "bing": { type: "http", behavior: "classical", url: baseUrl + "Bing/Bing.yaml", path: `./ruleset/bing.yaml`, interval: 86400 }, "oneDrive": { type: "http", behavior: "classical", url: baseUrl + "OneDrive/OneDrive.yaml", path: `./ruleset/oneDrive.yaml`, interval: 86400 }, } let microsoftRules = [ "RULE-SET,microsoft,Microsoft", "RULE-SET,bing,Microsoft", "RULE-SET,oneDrive,Microsoft" ] let microsoftGroup = { name: 'Microsoft', type: 'select', proxies: [mainSelect, "DIRECT"] } params["rule-providers"] = { ...microsoftProviders, ...params["rule-providers"] } params["rules"] = [...microsoftRules, ...params["rules"]] params["proxy-groups"] = [...params["proxy-groups"], microsoftGroup] } function myRules(params) { let rules = [ ...myDirectUrlList.map(e => 'DOMAIN-SUFFIX,' + e + ',DIRECT'), ...myProxyUrlList.map(e => 'DOMAIN-SUFFIX,' + e + ',' + mainSelect), ] console.log(rules) params["rules"] = [...rules, ...params["rules"]] } ``` |
20
fyxtc OP @peterli427 感谢感谢,很详细了,辛苦整理!
|
21
ewiglicht 251 天前 1
用规则集,然后自定义一些规则,感觉很少误判
rule-providers: # ... # custom-rules local custom-direct: type: file behavior: domain path: ./custom-rules/direct.yaml custom-proxy: type: file behavior: domain path: ./custom-rules/proxy.yaml custom-reject: type: file behavior: domain path: ./custom-rules/reject.yaml rules: # custom - RULE-SET,custom-reject,REJECT - RULE-SET,custom-direct,DIRECT - RULE-SET,custom-proxy,🚀 GitHub 上也有很多个人自定义的规则集,感觉用 rule-providers 方便 |
22
Mrealy 251 天前 1
我域名+IP 分流,中国域名用 114DNS 解析,国外域名用 1.1.1.1 或者 8.8.8.8 ,解析后国内 IP 走国内线路,其它走海外线路,用的 PANABIT 来做的。
|