abrclano / Meandering.Path

自用分流规则(预处理方法):适用于Clash for Windows和Clash Verge (verge-rev、nyanpasu),另含一些stash的复写模块。
101 stars 23 forks source link

[enhancement]大佬,Auto组加入Proxy组,然后Proxy默认选定Auto组能实现吗? #3

Closed lanceyliao closed 7 months ago

lanceyliao commented 7 months ago

https://github.com/abrclano/Meandering.Path/blob/538088e3dd5b837f6d8d4afd4b11e06e3c2b37e0/Clash.verge/Script/Rules.js#L144

lanceyliao commented 7 months ago

https://github.com/abrclano/Meandering.Path/blob/538088e3dd5b837f6d8d4afd4b11e06e3c2b37e0/Clash.verge/Script/Rules.js#L100 https://github.com/abrclano/Meandering.Path/blob/538088e3dd5b837f6d8d4afd4b11e06e3c2b37e0/Clash.verge/Script/Rules.js#L101 https://github.com/abrclano/Meandering.Path/blob/538088e3dd5b837f6d8d4afd4b11e06e3c2b37e0/Clash.verge/Script/Rules.js#L102

abrclano commented 7 months ago
const Proxy = { name: "Proxy", type: "select", proxies: ["Auto", ...(allProxies.length > 0 ? allProxies : ["DIRECT"])], icon: "https://fastly.jsdelivr.net/gh/Koolson/Qure/IconSet/Color/Proxy.png" };

或者

const Proxy = { name: "Proxy", type: "select", proxies: (allProxies.length > 0 ? allProxies : ["DIRECT"]).concat("Auto"), icon: "https://fastly.jsdelivr.net/gh/Koolson/Qure/IconSet/Color/Proxy.png" };

都可以,前者把Auto添加到Proxy分组的最前面,后者添加到分组的最后面,因为是select属性,所以默认选定Auto可能做不到,只能手动选择一下

lanceyliao commented 7 months ago

谢谢大佬,这边改成第一种了,这样Auto默认在第一个可选项

lanceyliao commented 7 months ago

这段正则看看有没有能参考的?

exclude_remarks = (公益|流量|时间|过期|无效|注册|回国|产品|免费|体验|广告位|请|群|官?网[站址]?|等级[12]|[vV](ip|IP)?[01])
abrclano commented 7 months ago

正则的话要看机场和个人使用需求,每个人的需求可能不一样,所以fork了改成适合自己的就行了,因为我的这个仓库也只是方便自己跨设备使用才弄的

lanceyliao commented 7 months ago

大佬,这是我之前clash mixin的配置,有好几个nameserver,想加进来是加在哪一行? https://github.com/abrclano/Meandering.Path/blob/538088e3dd5b837f6d8d4afd4b11e06e3c2b37e0/Clash.verge/Merge/Mixin.yaml#L57 还是 https://github.com/abrclano/Meandering.Path/blob/538088e3dd5b837f6d8d4afd4b11e06e3c2b37e0/Clash.verge/Merge/Mixin.yaml#L60 还是 https://github.com/abrclano/Meandering.Path/blob/538088e3dd5b837f6d8d4afd4b11e06e3c2b37e0/Clash.verge/Merge/Mixin.yaml#L62

mixin: # object
  dns:
    enable: true # 是否启用dns false
    ipv6: true # 开启 IPV6
    listen: 0.0.0.0:53 # dns 监听
    enhanced-mode: fake-ip # 模式:redir-host或fake-ip
    fake-ip-range: 198.18.0.1/16 # Fake IP addresses pool CIDR
    fake-ip-filter: # fake ip 白名单列表,如果你不知道这个参数的作用,请勿修改
      - "*.lan"
      - http://localhost.ptlogin2.qq.com/
      - +.srv.nintendo.net
      - +.stun.playstation.net
      - +.msftconnecttest.com
      - +.msftncsi.com
      - +.xboxlive.com
      - http://msftconnecttest.com/
      - xbox.*.microsoft.com
      - "*.battlenet.com.cn"
      - "*.battlenet.com"
      - "*.blzstatic.cn"
      - "*.battle.net"
    nameserver:
      - 223.5.5.5 # 阿里DNS
      - 180.76.76.76 # 百度DNS
      - 119.29.29.29 # 腾讯DNS
      - 117.50.10.10 # ONE DNS纯净版 直接返回其真实的响应结果
      - 114.114.114.114 # 114DNS
      - https://dns.alidns.com/dns-query # 阿里 DoH DNS
      - https://doh.360.cn/dns-query # 360 DoH DNS
    fallback:
      - 1.1.1.1
      - 8.8.8.8 # 谷歌DNS
      - tls://dns.rubyfish.cn:853
      - tls://1.0.0.1:853
      - tls://dns.google:853
      - https://dns.rubyfish.cn/dns-query
      - https://cloudflare-dns.com/dns-query
      - https://dns.google/dns-query
    fallback-filter:
      geoip: true # 默认
      geoip-code: CN
      ipcidr:
        - 240.0.0.0/4
lanceyliao commented 7 months ago

https://sing-box.sagernet.org/zh/configuration/inbound/tun/#strict_route 这B能防止DNS泄露,但是WSL就连不上代理了,醉了。

https://github.com/zzzgydi/clash-verge/issues/690 https://github.com/SagerNet/sing-box/issues/1327 https://github.com/2dust/v2rayN/issues/4416

lanceyliao commented 7 months ago

另外,merge和script里的设置,似乎会被clash verge设置栏UI里的设置覆盖?

abrclano commented 7 months ago

大佬,这是我之前clash mixin的配置,有好几个nameserver,想加进来是加在哪一行?

https://github.com/abrclano/Meandering.Path/blob/538088e3dd5b837f6d8d4afd4b11e06e3c2b37e0/Clash.verge/Merge/Mixin.yaml#L57

还是 https://github.com/abrclano/Meandering.Path/blob/538088e3dd5b837f6d8d4afd4b11e06e3c2b37e0/Clash.verge/Merge/Mixin.yaml#L60

还是 https://github.com/abrclano/Meandering.Path/blob/538088e3dd5b837f6d8d4afd4b11e06e3c2b37e0/Clash.verge/Merge/Mixin.yaml#L62

mixin: # object
  dns:
    enable: true # 是否启用dns false
    ipv6: true # 开启 IPV6
    listen: 0.0.0.0:53 # dns 监听
    enhanced-mode: fake-ip # 模式:redir-host或fake-ip
    fake-ip-range: 198.18.0.1/16 # Fake IP addresses pool CIDR
    fake-ip-filter: # fake ip 白名单列表,如果你不知道这个参数的作用,请勿修改
      - "*.lan"
      - http://localhost.ptlogin2.qq.com/
      - +.srv.nintendo.net
      - +.stun.playstation.net
      - +.msftconnecttest.com
      - +.msftncsi.com
      - +.xboxlive.com
      - http://msftconnecttest.com/
      - xbox.*.microsoft.com
      - "*.battlenet.com.cn"
      - "*.battlenet.com"
      - "*.blzstatic.cn"
      - "*.battle.net"
    nameserver:
      - 223.5.5.5 # 阿里DNS
      - 180.76.76.76 # 百度DNS
      - 119.29.29.29 # 腾讯DNS
      - 117.50.10.10 # ONE DNS纯净版 直接返回其真实的响应结果
      - 114.114.114.114 # 114DNS
      - https://dns.alidns.com/dns-query # 阿里 DoH DNS
      - https://doh.360.cn/dns-query # 360 DoH DNS
    fallback:
      - 1.1.1.1
      - 8.8.8.8 # 谷歌DNS
      - tls://dns.rubyfish.cn:853
      - tls://1.0.0.1:853
      - tls://dns.google:853
      - https://dns.rubyfish.cn/dns-query
      - https://cloudflare-dns.com/dns-query
      - https://dns.google/dns-query
    fallback-filter:
      geoip: true # 默认
      geoip-code: CN
      ipcidr:
        - 240.0.0.0/4

这个你去看看clash.meta的文档,照着写就行了

abrclano commented 7 months ago

另外,merge和script里的设置,似乎会被clash verge设置栏UI里的设置覆盖?

GUI的优先级比merge高所以会覆盖,另外verge-rev的新版在设置中加了tun的设置,merge里面的tun部分可能不会生效,但是script部分只写了规则应该不会覆盖。

lanceyliao commented 7 months ago

另外,merge和script里的设置,似乎会被clash verge设置栏UI里的设置覆盖?

GUI的优先级比merge高所以会覆盖,另外verge-rev的新版在设置中加了tun的设置,merge里面的tun部分可能不会生效,但是script部分只写了规则应该不会覆盖。

是的,merge里面的tun部分没生效(这边把tun那段干脆删了),但是script部分只写了规则没被覆盖。