Clash: [Bug] Health-check 的正确使用方式?

Created on 9 Jul 2020  ·  1Comment  ·  Source: Dreamacro/clash

感谢你向 Clash Core 提交 issue!
在提交之前,请确认:

  • [ ] 如果你可以自己 debug 并解决的话,提交 PR 吧!
  • [ ] 我已经在 Issue Tracker 中找过我要提出的问题
  • [ ] 我已经使用 dev 分支版本测试过,问题依旧存在
  • [x] 我已经仔细看过 Documentation 并无法自行解决问题
  • [x] 这是 Clash 核心的问题,并非我所使用的 Clash 衍生版本(如 OpenClash、KoolClash 等)的特定问题

请注意,如果你并没有遵照这个 issue template 填写内容,我们将直接关闭这个 issue。


Clash config


config.yaml

proxy-providers:
test:
type: file
path: /test.yaml
health-check:
enable: true
url: url_sample.com
interval: 375
......
proxy-groups:
- name: test-group
type: select
use:
- test

Clash logs

不相关

环境 Environment

  • 操作系统 (the OS that the Clash core is running on)
    OpenWRT Arm

  • 网路环境或拓扑 (network conditions/topology)
    不相关

  • iptables,如果适用 (if applicable)
    不相关

  • ISP 有没有进行 DNS 污染 (is your ISP performing DNS pollution?)

    不相关

  • 其他 (any other information that would be useful)

    不相关

说明 Description

实现能够在一定间隔后自动切换故障服务器的功能。

在使用 proxy-providers 前,是通过 proxy-groupsfallback 实现的。

使用了 proxy-providers 后,是通过 provider 中的 health-check 并且搭配 proxy-groupsselect 实现,发现不能达到预计效果。

重现问题的具体布骤 Steps to Reproduce

我预期会发生?

本以为 provider 中的 health-check 已经会定时检测并且会忽略故障服务器,从而在 proxy-groups 中无需再使用 fallback 进行故障切换。因为在文档中有这么一句话:

Health check is available for both modes, and works exactly like fallback in Proxy Groups.

不知道是不是我理解有误?望指教。

实际上发生了什么?
实际上并未如愿进行故障切换,proxy-groups 中仍然选中了故障节点。

可能的解决方案 Possible Solution

通过在 proxy-groups 中使用 fallback 是能解决的,但是功能上会不会与 health-check 产生冲突?还是说已经考虑到了这部分,实际上在 proxy-groups 中的 url-testfallback 的检测均是基于 health-check 的结果,而不是再发起连接进行探测?

Most helpful comment

普通的组,比如

- name: "auto"
  type: url-test
  proxies:
    - ss1
    - ss2
    - vmess1
    # tolerance: 150
  url: 'http://www.gstatic.com/generate_204'
  interval: 300

包含着代理 proxies 和逻辑 url-test 以及检查 interval。provider 本身包含着代理 proxies 和检查 interval,所以想用逻辑 url-test 就必须

- name: "auto"
  type: url-test
  use:
    - provider

而此时另外三个字段 proxies urlinterval,你可以理解为他包装成了一个 provider

>All comments

普通的组,比如

- name: "auto"
  type: url-test
  proxies:
    - ss1
    - ss2
    - vmess1
    # tolerance: 150
  url: 'http://www.gstatic.com/generate_204'
  interval: 300

包含着代理 proxies 和逻辑 url-test 以及检查 interval。provider 本身包含着代理 proxies 和检查 interval,所以想用逻辑 url-test 就必须

- name: "auto"
  type: url-test
  use:
    - provider

而此时另外三个字段 proxies urlinterval,你可以理解为他包装成了一个 provider

Was this page helpful?
0 / 5 - 0 ratings

Related issues

luvletter2333 picture luvletter2333  ·  5Comments

OneHappyForever picture OneHappyForever  ·  3Comments

dazirangege picture dazirangege  ·  3Comments

FenghenHome picture FenghenHome  ·  6Comments

wangxin6 picture wangxin6  ·  4Comments