MetaCubeX / mihomo

A simple Python Pydantic model for Honkai: Star Rail parsed data from the Mihomo API.
https://wiki.metacubex.one
MIT License
16.02k stars 2.6k forks source link

[Bug] 多个节点套用相同的反代 cf ip 和端口,使用 clash verge rev 进行延迟测试时,节点经常性会 tcp 阻断,但过一会儿又可以用了,使用 v2rayN 和 GUI.for.SingBox 没有这个问题 #1584

Closed qcmoke closed 9 hours ago

qcmoke commented 4 days ago

Verify steps

Operating System

Windows

System Version

Windows11 23H2

Mihomo Version

v1.18.9

Configuration File

mixed-port: 7890 # 局域网访问Port
bind-address: "*" #绑定IP地址
allow-lan: true # 允许局域网访问
mode: rule # 模式
log-level: info # 日志等级
tcp-concurrent: true # tcp 并发模式
ipv6: true #是否支持 IPv6(软路由上不建议开启)
# interface-name: eth0  (软路由上根据情况指定出站接口)
unified-delay: true # 开启统一延迟时,会计算 RTT,以消除连接握手等带来的不同类型节点的延迟差异
find-process-mode: strict # 匹配进程 always/strict/off
global-client-fingerprint: chrome
keep-alive-idle: 600
keep-alive-interval: 30

profile:
  store-selected: false # 持久化策略组选择
  store-fake-ip: true # 持久化 fake-ip 缓存

# 控制面板
#external-controller: 0.0.0.0:9090
external-controller: 127.0.0.1:9097
secret: xxxxx

tun:
  enable: false #是否启用 tun 模式(建议 PC端开启 路由器不开启)
  stack: mixed # tun 模式堆栈,可用值: system/gvisor/mixed,如无使用问题,建议使用 mixed栈,默认 gvisor
  auto-route: true #自动设置全局路由,可以自动将全局流量路由进入 tun 网卡
  route-address: #启用 auto-route 时路由自定义路由网段
    - 0.0.0.0/1
    - 128.0.0.0/1
    - ::/1
    - 8000::/1
  auto-detect-interface: true #自动选择流量出口接口,多出口网卡同时连接的设备建议手动指定出口网卡
  dns-hijack: #dns 劫持,将匹配到的连接导入内部 dns 模块,不书写协议则为 udp://
    - any:53
  device: utun_clash #指定 tun 网卡名称,MacOS 设备只能使用 utun 开头的网卡名
  mtu: 9000
  strict-route: true
  endpoint-independent-nat: false #启用独立于端点的 NAT,性能可能会略有下降,所以不建议在不需要的时候开启

dns:
  enable: true
  ipv6: false
  enhanced-mode: fake-ip #DNS 处理模式,可选值 fake-ip/redir-host,默认 redir-host
  fake-ip-range: 198.18.0.1/16 #fakeip 下的 IP 段设置,tun 的默认 IPV4 地址 也使用此值作为参考
  fake-ip-filter-mode: blacklist #可选 blacklist/whitelist,默认 blacklist,whitelist 即只有匹配成功才返回 fake-ip
  fake-ip-filter: # fakeip 过滤,以下地址不会下发 fakeip 映射用于连接
    - "*" # 单独的一个 * 只会匹配 localhost 等没有 . 的主机名
    - "+.lan"
    - "+.local"
    - "*.msftconnecttest.com"
    - "*.msftncsi.com"
    - "time.*.com"
    - "ntp.*.com"
    - geosite:private
    - geosite:cn
  use-hosts: true # 是否启用 yaml 配置中的 hosts 配置(如果有),默认 true
  use-system-hosts: true # 是否查询系统 hosts,默认 true
  default-nameserver: #默认 DNS, 用于解析 DNS 服务器的域名,必须为 IP, 可为加密 DNS
    - 223.5.5.5 # 阿里 DNS
    - 119.29.29.29 # 腾讯 DNS
  nameserver: #默认的域名解析服务器
    - https://doh.pub/dns-query # 腾讯 DNS
    - https://dns.alidns.com/dns-query # 阿里 DNS
    - https://dns.cloudflare.com/dns-query # Cloudflare DNS
    - https://dns.google/dns-query # 谷歌 DNS
  proxy-server-nameserver: #代理节点域名解析服务器,仅用于解析代理节点的域名,如果不填则遵循 nameserver-policy、nameserver 和 fallback 的配置
    - https://doh.pub/dns-query
    - https://dns.alidns.com/dns-query
  nameserver-policy: #指定域名查询的解析服务器,可使用 geosite, 优先于 nameserver/fallback 查询
    "geosite:cn":
      - https://doh.pub/dns-query
      - https://dns.alidns.com/dns-query
    "geosite:geolocation-!cn":
      - https://dns.cloudflare.com/dns-query
      - https://dns.google/dns-query
  respect-rules: false # dns 连接是否遵守路由规则(默认不启用,如果启用,需配置 proxy-server-nameserver)

# geodata 配置
geodata-mode: true
geodata-loader: standard # GEO 文件加载模式(standard:标准加载器;memconservative:专为内存受限 (小内存) 设备优化的加载器 (默认值))
geo-auto-update: true #自动更新 geoip 和 geosite 文件
geo-update-interval: 48
geox-url: # 自定义 geodata url
  geoip: https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.dat
  geosite: https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat
  mmdb: https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/country-lite.mmdb
  asn: https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/GeoLite2-ASN.mmdb

# 流量嗅探
sniffer:
  enable: true
  sniff:
    HTTP:
      ports: [80, 8080-8880]
      override-destination: true
    TLS:
      ports: [443, 8443]
    QUIC:
      ports: [443, 8443]
  force-domain:
    - +.v2ex.com
  skip-domain:
    - "dlg.io.mi.com"
    - "+.push.apple.com"
    - "+.apple.com"

# 用于下载订阅时指定UA
global-ua: clash.meta

#代理集
proxy-providers:
  subscribe1: #自定义机场名称
    type: http
    url: "https://xxx1.com/sub?xxx" #订阅链接存放在双引号内
    proxy: DIRECT
    interval: 1800 #订阅自动更新时间 单位:秒
    path: ./providers/subscribe1.yaml # 默认只允许存储在 clash 的 Home Dir,如果想存储到任意位置,添加环境变量 SKIP_SAFE_PATH_CHECK=1
    health-check:
      enable: true
      interval: 300
      # lazy: true
      url: https://www.gstatic.com/generate_204
  subscribe2: #自定义机场名称
    type: http
    url: "https://xxx2.com/sub?xxx" #订阅链接存放在双引号内
    proxy: DIRECT
    interval: 1800 #机场订阅自动更新时间 单位:秒
    path: ./providers/subscribe2.yaml # 默认只允许存储在 clash 的 Home Dir,如果想存储到任意位置,添加环境变量 SKIP_SAFE_PATH_CHECK=1
    health-check:
      enable: true
      interval: 300
      # lazy: true
      url: https://www.gstatic.com/generate_204

#规则集
rule-providers:
  #需直连软件
  applications:
    type: http
    behavior: classical
    interval: 86400
    path: ./ruleset/applications.yaml
    url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/applications.txt"

# 自定义入站监听端口
listeners:
  - name: mixed-in-7893-keep_account
    type: mixed
    port: 7893
    listen: 0.0.0.0
    udp: true
  - name: mixed-in-7894-163email
    type: mixed
    port: 7894
    listen: 0.0.0.0
    udp: true

######### 锚点 start #######
# 订阅选择
prsub: &prsub { use: [subscribe1] }
common_proxies:
  &common_proxies {
    type: select,
    proxies: [🚀 节点选择, 🎈 自动选择],
    <<: *prsub,
  }
######### 锚点 end #######

#节点存放地址
proxies: []

#代理组
proxy-groups:
  #节点选择
  - name: 🚀 节点选择
    type: select
    proxies: [🎈 自动选择]
    <<: *prsub
  #自动选择
  - name: 🎈 自动选择
    type: url-test
    hidden: false
    proxies: []
    <<: *prsub
    url: "http://www.gstatic.com/generate_204"
    interval: 300 #自动测速周期,单位:秒
  - { name: "🎯 全球直连", type: select, proxies: [DIRECT, 🚀 节点选择] }
  - { name: "🆎 AdBlock", type: select, proxies: [REJECT, 🎯 全球直连] } # 广告拦截
  - { name: 🍀 Google, <<: *common_proxies }
  - {
      name: 📹 YouTube,
      type: select,
      proxies: [🍀 Google, 🚀 节点选择, 🎈 自动选择],
      <<: *prsub,
    }
  - {
      name: Ⓜ️ 微软服务,
      type: select,
      proxies: [🎯 全球直连, 🚀 节点选择, 🎈 自动选择],
      <<: *prsub,
    }
  - {
      name: 🐬 OneDrive,
      type: select,
      proxies: [Ⓜ️ 微软服务, 🎯 全球直连, 🚀 节点选择, 🎈 自动选择],
      <<: *prsub,
    }
  - {
      name: 🍎 苹果服务,
      type: select,
      proxies: [🎯 全球直连, 🚀 节点选择, 🎈 自动选择],
      <<: *prsub,
    }
  - { name: 🤖 ChatGPT, <<: *common_proxies }
  - { name: 🎥 Netflix, <<: *common_proxies }
  - { name: 🎥 Disney, <<: *common_proxies }
  - { name: 🎵 TikTok, <<: *common_proxies }
  - { name: 📲 电报信息, <<: *common_proxies }
  - { name: 👨🏿‍💻 GitHub, <<: *common_proxies }
  - { name: 🌍 通用保号, <<: *common_proxies }
  - { name: 🌍 网易邮箱大师, <<: *common_proxies }
  - { name: 🐟 漏网之鱼, <<: *common_proxies }

rules:
  #在这里添加自定义直连规则
  - IN-NAME,mixed-in-7893-keep_account,🌍 通用保号
  - IN-NAME,mixed-in-7894-163email,🌍 网易邮箱大师
  - DOMAIN-SUFFIX,voidsec.com,🚀 节点选择 #voidsec 礼貌性添加所谓的dns泄露检测站
  - DOMAIN-SUFFIX,browserleaks.com,🚀 节点选择 #browserleaks 礼貌性添加所谓的dns泄露检测站
  - DOMAIN-SUFFIX,ipleak.net,🚀 节点选择 #ipleak 礼貌性添加所谓的dns泄露检测站

  #IP规则(不处理)
  - GEOIP,telegram,📲 电报信息,no-resolve
  - GEOIP,netflix,🎥 Netflix,no-resolve
  - GEOIP,google,🍀 Google,no-resolve

  #域名规则
  - RULE-SET,applications,🎯 全球直连
  - GEOSITE,private,🎯 全球直连
  - GEOSITE,category-ads-all,🆎 AdBlock
  - GEOSITE,adobe,🆎 AdBlock # 屏蔽 adobe
  - GEOSITE,steam@cn,🎯 全球直连
  - GEOSITE,category-games@cn,🎯 全球直连
  - GEOSITE,cn,🎯 全球直连

  - GEOSITE,youtube,📹 YouTube
  - GEOSITE,google,🍀 Google
  - GEOSITE,github,👨🏿‍💻 GitHub
  - GEOSITE,onedrive,🐬 OneDrive
  - GEOSITE,microsoft,Ⓜ️ 微软服务 #说明:geosite:microsoft 包含 geosite:github 和 geosite:onedrive 等,参考:https://github.com/v2fly/domain-list-community/blob/master/data/microsoft
  - GEOSITE,microsoft@cn,Ⓜ️ 微软服务
  - GEOSITE,icloud,🍎 苹果服务
  - GEOSITE,apple,🍎 苹果服务
  - GEOSITE,openai,🤖 ChatGPT
  - GEOSITE,netflix,🎥 Netflix
  - GEOSITE,disney,🎥 Disney
  - GEOSITE,tiktok,🎵 TikTok
  - GEOSITE,telegram,📲 电报信息

  - GEOSITE,facebook,🚀 节点选择
  - GEOSITE,twitter,🚀 节点选择
  - GEOSITE,spotify,🚀 节点选择
  - GEOSITE,category-scholar-!cn,🚀 节点选择
  - GEOSITE,geolocation-!cn,🚀 节点选择
  - GEOSITE,gfw,🚀 节点选择

  #IP规则(处理)
  - GEOIP,private,🎯 全球直连
  - GEOIP,cn,🎯 全球直连

  #最终匹配 白名单模式
  - MATCH,🐟 漏网之鱼

Description

多个节点套用相同的反代 cf ip 和端口,使用 clash verge rev 进行延迟测试时,节点经常性会 tcp 阻断,但过一会儿又可以用了,使用 v2rayN 和 GUI.for.SingBox 没有这个问题

Reproduction Steps

no

Logs

No response

xishang0128 commented 4 days ago
xishang0128 commented 9 hours ago

You are not directly running the core test, and cannot provide support