mihomo-party-org / mihomo-party

:electron: Another Mihomo GUI.
https://mihomo.party
GNU General Public License v3.0
5.79k stars 325 forks source link

RULE-SET配置在rule-providers中type: file无效的问题 #359

Closed gsuns closed 4 hours ago

gsuns commented 4 hours ago

Verify steps

操作系统

Windows

描述

版本 Windows 11 专业版 22H2 Mihomo应用版本1.5.10 内核 Alpha-de19f92

简短描述: 我将需要代理的域名 和 不需要代理的域名 和 需要代理的应用,做成了3个 .Yaml 文件 Mihomo 目录:D:\Program Files\M 规则目录:D:\Program Files\M\User\Rule

Image

并配置了rule-providers:最后在 rules: 中 使用 RULE-SET 选择出站. 但没有效果,我有查阅过 https://wiki.metacubex.one/config/rule-providers/?h=behavior#format https://wiki.metacubex.one/config/rule-providers/content/?h=providers https://wiki.metacubex.one/config/rules/?h=rule+providers 实在时找不到头绪 我不知道是我配置错误,还是没有此功能,只是希望可以获得解答.谢谢

请看配置: Mihomo Config

rule-providers:
# 域名 - 直连
  DomainDirect:
    type: file
    format: yaml
    behavior: domain
    interval: 60
    path: /User/Rule/DomainDirect.yaml
  # 域名 - 代理
  DomainProxy:
    type: file
    format: yaml
    behavior: domain
    interval: 60
    path: ./User/Rule/DomainProxy.yaml
  #应用 - 代理
  ApplicationsProxy:
    type: file
    format: yaml
    behavior: classical
    interval: 60
    path: /User/Rule/ApplicationsProxy.yaml

rules:
  # 私有地址 - 直连
  - IP-CIDR,10.0.0.0/8,DIRECT
  - IP-CIDR,172.16.0.0/12,DIRECT
  - IP-CIDR,192.168.0.0/16,DIRECT

  - IP-CIDR,127.0.0.0/8,DIRECT
  - IP-CIDR,169.254.0.0/16,DIRECT

  # GEOIP 规则
  - GEOIP,CN,DIRECT

  # GEOSITE 规则
  - GEOSITE,category-ads-all,REJECT
  - GEOSITE,private,DIRECT
  - GEOSITE,cn,DIRECT

  # IP代理
  - IP-CIDR,1.1.1.1/32,Proxy
  - IP-CIDR,1.0.0.1/32,Proxy
  - IP-CIDR,8.8.8.8/32,Proxy
  - IP-CIDR,8.8.4.4/32,Proxy

  # 域名 - 直连
  - RULE-SET,DomainDirect,DIRECT
  # 域名 - 代理
  - RULE-SET,DomainProxy,Proxy
  # 应用代理
  - RULE-SET,ApplicationsProxy,Proxy

  - MATCH,DIRECT

/User/Rule/DomainDirect.yaml内容:

payload:
  - '+.cn'
  - '+.alicdn.com'
  - '+.aliyun.com'
  - '+.alipay.com'
  - '+.alipayobjects.com'
  - '+.alibaba.com'
  - '+.alipay.cn'
  - '+.ele.me'
  - '+.elemecdn.com'
  - '+.mmstat.com'
  - '+.qq.com'
  - '+.qq.com.cn'
  - '+.tencent.com'
  - '+.tencent-cloud.net'
  - '+.wechat.com'
  - '+.bilibili.com'
  - '+.bilivideo.com'
  - '+.hdslb.com'
  - '+.taobao.com'
  - '+.jd.com'
  - '+.360buyimg.com'
  - '+.163.com'
  - '+.163jiasu.com'
  - '+.kunluncan.com'
  - '+.alikunlun.com'
  - '+.126.net'
  - '+.127.net'
  - '+.netease.com'
  - '+.huawei.com'
  - '+.baidu.com'
  - '+.bdstatic.com'
  - '+.bcebos.com'
  - '+.xiaohongshu.com'
  - '+.xhscdn.com'

/User/Rule/DomainProxy.yaml内容:

payload:
  - '+.google.com'

ApplicationsProxy.yaml内容:

payload:
  - PROCESS-NAME,steamwebhelper.exe

运行结果: Image Image

尝试把规则全卸载 Rules:中的配置:

#rule-providers:
## 域名 - 直连
#  DomainDirect:
#    type: file
#    format: yaml
#    behavior: domain
#    interval: 60
#    path: /User/Rule/DomainDirect.yaml
#  # 域名 - 代理
#  DomainProxy:
#    type: file
#    format: yaml
#    behavior: domain
#    interval: 60
#    path: ./User/Rule/DomainProxy.yaml
#  #应用 - 代理
#  ApplicationsProxy:
#    type: file
#    format: yaml
#    behavior: classical
#    interval: 60
#    path: /User/Rule/ApplicationsProxy.yaml

rules:
  # 应用直连
  - PROCESS-NAME,H.exe,DIRECT
  - PROCESS-NAME,dnscrypt-proxy.exe,DIRECT

  # 私有地址 - 直连
  - IP-CIDR,10.0.0.0/8,DIRECT
  - IP-CIDR,172.16.0.0/12,DIRECT
  - IP-CIDR,192.168.0.0/16,DIRECT

  - IP-CIDR,127.0.0.0/8,DIRECT
  - IP-CIDR,169.254.0.0/16,DIRECT

  # GEOIP 规则
  - GEOIP,CN,DIRECT

  # GEOSITE 规则
  - GEOSITE,private,DIRECT
  - GEOSITE,cn,DIRECT

  # IP代理
  - IP-CIDR,1.1.1.1/32,Proxy
  - IP-CIDR,1.0.0.1/32,Proxy
  - IP-CIDR,8.8.8.8/32,Proxy
  - IP-CIDR,8.8.4.4/32,Proxy

#  # 域名 - 直连
#  - RULE-SET,DomainDirect,DIRECT
#  # 域名 - 代理
#  - RULE-SET,DomainProxy,Proxy
#  # 应用代理
#  - RULE-SET,ApplicationsProxy,Proxy

# 域名直连
  - DOMAIN-SUFFIX,cn,DIRECT
  - DOMAIN-SUFFIX,alicdn.com,DIRECT
  - DOMAIN-SUFFIX,aliyun.com,DIRECT
  - DOMAIN-SUFFIX,alipay.com,DIRECT
  - DOMAIN-SUFFIX,alipayobjects.com,DIRECT
  - DOMAIN-SUFFIX,alibaba.com,DIRECT
  - DOMAIN-SUFFIX,alipay.cn,DIRECT
  - DOMAIN-SUFFIX,ele.me,DIRECT
  - DOMAIN-SUFFIX,elemecdn.com,DIRECT
  - DOMAIN-SUFFIX,mmstat.com,DIRECT
  - DOMAIN-SUFFIX,qq.com,DIRECT
  - DOMAIN-SUFFIX,qq.com.cn,DIRECT
  - DOMAIN-SUFFIX,tencent.com,DIRECT
  - DOMAIN-SUFFIX,tencent-cloud.net,DIRECT
  - DOMAIN-SUFFIX,wechat.com,DIRECT
  - DOMAIN-SUFFIX,bilibili.com,DIRECT
  - DOMAIN-SUFFIX,bilivideo.com,DIRECT
  - DOMAIN-SUFFIX,hdslb.com,DIRECT
  - DOMAIN-SUFFIX,taobao.com,DIRECT
  - DOMAIN-SUFFIX,jd.com,DIRECT
  - DOMAIN-SUFFIX,360buyimg.com,DIRECT
  - DOMAIN-SUFFIX,163.com,DIRECT
  - DOMAIN-SUFFIX,163jiasu.com,DIRECT
  - DOMAIN-SUFFIX,kunluncan.com,DIRECT
  - DOMAIN-SUFFIX,alikunlun.com,DIRECT
  - DOMAIN-SUFFIX,126.net,DIRECT
  - DOMAIN-SUFFIX,127.net,DIRECT
  - DOMAIN-SUFFIX,netease.com,DIRECT
  - DOMAIN-SUFFIX,huawei.com,DIRECT
  - DOMAIN-SUFFIX,baidu.com,DIRECT
  - DOMAIN-SUFFIX,bdstatic.com,DIRECT
  - DOMAIN-SUFFIX,bcebos.com,DIRECT
  - DOMAIN-SUFFIX,xiaohongshu.com,DIRECT
  - DOMAIN-SUFFIX,xhscdn.com,DIRECT

# 域名代理
  - DOMAIN-SUFFIX,google.com,Proxy

# 应用代理
  - PROCESS-NAME,steamwebhelper.exe,Proxy

  - MATCH,DIRECT

运行结果: Image Image

请帮助我,感谢!!!

mihomo-party-bot[bot] commented 4 hours ago

由于您未勾选确认这是针对GUI程序的请求,因此该Issue将被关闭。如果这是针对GUI程序的请求,请确保所有步骤均已勾选后重新提交。感谢您的理解!