
https://github.com/zckevin/Clash.Meta/tree/http2ping_new/adapter/outboundgroup/http2ping
使用 HTTP2 Ping Frame 监测链路 rtt, 并从中选择 rtt 最优的链路
相比于url-test, http2ping 针对每个 endpoint 建立一条 HTTP2 长连接, 避免了频繁建立/断开连接, 因此我们可以使用更低的 interval(1s) 进行接近实时的 rtt 监测.
相比于使用ICMP ping进行延迟检测, 对于某些使用中转服务的网络接入供应商, ICMP packets 只能检测用户->中转->落地这条链路的第一部分而非整条链路的完整 RTT.
相比于使用http://www.gstatic.com/generate_204这类常见的基于 HTTP 的 health check, 如果使用 HTTP 协议, 部分鸡贼的网络接入供应商会在中转服务器进行 MITM 直接返回 HTTP 204 response, 以试图欺骗客户.
# enable verbose logging for more infomation log-level: debug proxy-groups: - name: min-rtt-group type: http2-ping filter: "hk" use: - airport_1 # interval milliseconds for sending Ping frame, default value: 1000ms interval: 1000 # tolerance for changing current best route, default value: 0ms tolerance: 0 # target server, default server: https://cloudflare.com server: https://cloudflare.com #!/bin/bash interface=enp1s0 ip=1.1.1.1 delay=100ms # add latency to ip address tc qdisc add dev $interface root handle 1: prio tc filter add dev $interface parent 1:0 protocol ip prio 1 u32 match ip dst $ip flowid 2:1 tc qdisc add dev $interface parent 1:1 handle 2: netem delay $delay # remove tc rules tc qdisc del dev $interface root 1 yyysuo 2024-01-09 17:16:01 +08:00 这么好的东西,能给 mihomo 提 pr 么,大佬们正对 healthy check 不满意呢。 |
2 NouveauNom 2024-01-09 18:26:52 +08:00 cfw mac 能用吗 |
3 issakchill 2024-01-09 20:55:10 +08:00 支持提 pr |
4 zckevin OP |
5 zckevin OP |
6 shunia 2024-01-10 10:35:53 +08:00 惊了,我以为这个 mihomo 还真是个星铁的工具呢。心说给游戏工具提这种 PR 干啥哈哈哈哈哈。 |
7 mapperv 2024-01-10 10:46:19 +08:00 airport_1 未定义是啥原因? |
8 mapperv 2024-01-10 10:47:18 +08:00 |
9 zckevin OP |
10 mapperv 2024-01-10 11:26:21 +08:00 |
11 mapperv 2024-01-10 11:31:42 +08:00 - {name: 自动选择, <<: *use, tolerance: 2, type: url-test} 自带的 url-test 是这么配置的,是不是更改实际上是不是更改 type 然后加上 server 配置应该就可以了,但是好像没有这个 type |