Skip to content

feat: support configurable health check requests#2771

Open
techblack wants to merge 1 commit into
MetaCubeX:Alphafrom
techblack:Alpha
Open

feat: support configurable health check requests#2771
techblack wants to merge 1 commit into
MetaCubeX:Alphafrom
techblack:Alpha

Conversation

@techblack

Copy link
Copy Markdown

将节点“存活” 扩充能力为 “可用”

支持了

    check-method: http_head # 健康检查请求方法,可选 http_head / http_get,默认 http_head
    http-headers: # 健康检查请求头,用于可能的需要验证的url,可用于 http_head / http_get
      - name: User-Agent
        value: mihomo
      - name: Accept
        value: text/plain
    expected-body-match: "(?i)success" # 仅 check-method 为 http_get 时生效,使用正则表达式匹配响应体,匹配成功才认为节点可用;http_get 默认支持 gzip/br 解压缩

使用场景: 通过http_get某些url的返回值 来判断该节点是否可用于某些特定服务(在现在AI封锁的情况下,开始变得越来越重要)

btw: 后续对于一些特定场景可能也会支持http_post :)
··

例如

地理分区 https://1.1.1.1/cdn-cgi/trace 可获取到节点地理位置,这样该组节点alive的都是某一节点

  - name: "HK地区"
    type: url-test
    proxies:
      - ss1
      - ss2
      - vmess1
    check-method: http_get
    expected-body-match: "(?i)loc=HK"

流媒体解锁

  - name: "奈飞自制解锁"
    type: fallback
    proxies:
      - ss1
      - ss2
      - vmess1
    url: https://www.netflix.com/title/70143836
    check-method: http_get
    expected-body-match: "(?i)Breaking"

@wwqgtxx wwqgtxx force-pushed the Alpha branch 4 times, most recently from cfbc2aa to 6ea4373 Compare May 14, 2026 07:39
@techblack

Copy link
Copy Markdown
Author

@wwqgtxx any ideas?

@wwqgtxx wwqgtxx force-pushed the Alpha branch 2 times, most recently from a86ca4f to d2fcf71 Compare May 17, 2026 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant