XIU2/CloudflareSpeedTest · warning
[调试] IP: %s, 延迟测速终止,HTTP 状态码: %d, 测速地址: %s
Error message
[调试] IP: %s, 延迟测速终止,HTTP 状态码: %d, 测速地址: %s
What it means
Debug branch in task/httping.go:64-70: the first HTTPing response returned a status code outside the accepted set. When -httping-code is 0 (or the intended-invalid check trips, see error 6), only 200, 301, 302 count as pass, so a 403/404/5xx/redirect-code like 308 fails the IP. The IP gets return 0, 0, "" and disappears from results.
Source
Thrown at task/httping.go:67
}
return 0, 0, ""
}
request.Header.Set("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36")
response, err := hc.Do(request)
if err != nil {
if utils.Debug { // 调试模式下,输出更多信息
utils.Red.Printf("[调试] IP: %s, 延迟测速失败,错误信息: %v, 测速地址: %s\n", ip.String(), err, URL)
}
return 0, 0, ""
}
defer response.Body.Close()
//fmt.Println("IP:", ip, "StatusCode:", response.StatusCode, response.Request.URL)
// 如果未指定的 HTTP 状态码,或指定的状态码不合规,则默认只认为 200、301、302 才算 HTTPing 通过
if HttpingStatusCode == 0 || HttpingStatusCode < 100 && HttpingStatusCode > 599 {
if response.StatusCode != 200 && response.StatusCode != 301 && response.StatusCode != 302 {
if utils.Debug { // 调试模式下,输出更多信息
utils.Red.Printf("[调试] IP: %s, 延迟测速终止,HTTP 状态码: %d, 测速地址: %s\n", ip.String(), response.StatusCode, URL)
}
return 0, 0, ""
}
} else {
if response.StatusCode != HttpingStatusCode {
if utils.Debug { // 调试模式下,输出更多信息
utils.Red.Printf("[调试] IP: %s, 延迟测速终止,HTTP 状态码: %d, 指定的 HTTP 状态码 %d, 测速地址: %s\n", ip.String(), response.StatusCode, HttpingStatusCode, URL)
}
return 0, 0, ""
}
}
io.Copy(io.Discard, response.Body)
// 通过头部参数获取地区码
colo = getHeaderColo(response.Header)
// 只有指定了地区才匹配机场地区码View on GitHub (pinned to 1da0c025d7)
Solutions
- Probe your -url directly with the same method: curl -I https://your-url and check the status code it actually returns.
- If the endpoint legitimately returns a different code every time (e.g. 301 or 204), pass it via -httping-code 301.
- If the endpoint is broken, point -url at a reliable, self-hosted static file that answers 200 to HEAD.
- When testing non-Cloudflare CDNs, verify what status that CDN returns and set -httping-code accordingly.
Example fix
# before ./cfst -httping -url https://example.com/speed # server returns 204 on HEAD # after ./cfst -httping -url https://example.com/speed -httping-code 204
Defensive patterns
Strategy: validation
Validate before calling
# confirm what the endpoint answers to HEAD before choosing expectations
code=$(curl -sI -o /dev/null -w '%{http_code}' https://speed.example.com/)
echo "endpoint answers: $code" # feed this to -httping-code if not 200/301/302 Type guard
func acceptedStatus(code int, want int) bool {
if want == 0 { // mirror the default set from httping.go:64-70
return code == 200 || code == 301 || code == 302
}
return code == want
} Prevention
- curl -I your -url once; anything outside 200/301/302 needs an explicit -httping-code.
- Self-host the latency endpoint so status behavior is stable.
- Remember default acceptance is exactly 200/301/302 — 204/304 fail.
When it happens
Trigger: A -url endpoint that answers non-200 to HEAD on the tested IP: WAF/anti-bot rules returning 403/503, a speed file moved to 404, an origin returning 500, or a CDN that answers HEAD with 405. Also happens when testing non-Cloudflare IP ranges whose anycast serves different status codes.
Common situations: Using the default https://cf.xiu2.xyz/url after it started answering errors; self-hosted speed endpoints that reject HEAD; DDoS-protection layers (Cloudflare Under Attack mode) returning 503 challenges; a stale tutorial URL that now 301s to a login page (301 is accepted, but the target content isn't).
Related errors
- [调试] IP: %s, 延迟测速请求创建失败,错误信息: %v, 测速地址: %s
- [调试] IP: %s, 延迟测速失败,错误信息: %v, 测速地址: %s
- [提示] 在使用 [-sl] 参数时,建议搭配 [-tl] 参数,以避免因凑不够 [-dn] 数量而一直测速...
- ParseCIDR err
- err
AI-assisted analysis of XIU2/CloudflareSpeedTest@1da0c025d7 (2026-08-15).
Data as JSON: /api/errors/152016de1e8abbe6.
Report an issue: GitHub.