🚀 API地址延迟测试

测试各地址响应速度,按延迟从低到高排名

点击上方按钮开始测试
How this works / 工作原理

What it measures

Round-trip time from your browser to each API endpoint — the network part you actually pay for, not the model's thinking time. Every visitor measures their own network, so the ranking is theirs, not the author's.

The trick that makes it possible

  1. performance.now() is read immediately before and after an await fetch(...). The difference is the request's wall-clock time.
  2. The fetch uses mode:'no-cors', so no Access-Control-Allow-Origin header is needed — the response arrives opaque (body unreadable, status 0). We never read the body; we only need the moment it resolves.
  3. Timing survives because a no-cors request is still a real HTTP request: DNS + TCP + TLS + server processing + first byte all happen and are included in the delta.
  4. AbortController cancels the request after 5 s, so a dead endpoint becomes a null → shown as 超时 (timeout) instead of hanging the page.
  5. Each address is probed 3× with 100 ms between samples, then averaged — one lucky sample can't win the ranking.
  6. renderResults() sorts by that average with unknowns last, and paints rank-1/2/3 badges on the first three cards.
  7. The testUrl is deliberately a cheap /health path: latency, not throughput, and no quota is spent on your API key.

Why three addresses look ⛔ on this page

Those mirrors answer on plain http://…:11223 with no TLS. A page served over https:// is not allowed to open an http:// request (mixed content), so the browser refuses before any packet leaves. The guard reports ⛔ mixed content rather than a fake 0 ms or a fake timeout. Open this same file from disk (file://) or over http:// and all of them test normally.

Copy of a relay's own address tester (API地址延迟测试) — markup, CSS and measurement logic are the original; the HTTPS endpoints, the mixed-content guard and this panel were added so it runs on an HTTPS site.