fix: unify default latency test URL and update workflows/backend logic

- All delay test logic, Rust MihomoManager, API, cmds, delay.ts, settings, and group editor now use the Cloudflare 204 test URL
- Fixed outdated URLs in docs and comments
- Fix Github Actions workflow: unexpected neeeds run
This commit is contained in:
Tunglies
2025-06-02 14:07:54 +08:00
parent 06130b95d2
commit 1bcb6646c4
8 changed files with 9 additions and 11 deletions

View File

@@ -424,9 +424,7 @@ jobs:
autobuild-x86-arm-windows_webview2:
name: Autobuild x86 and ARM Windows with WebView2
needs: check_commit
if: ${{ needs.check_commit.outputs.should_run == 'true' }}
# needs: update_tag
needs: update_tag
strategy:
fail-fast: false
matrix:

View File

@@ -88,7 +88,7 @@
- 配置文件缺失 secret 字段时自动填充默认值 set-your-secret
- 优化异步处理,防止部分组件 UI 阻塞
- 关闭 DNS 启用
- 延迟测试链接更换为 Https 协议 https://www.gstatic.com/generate_204
- 延迟测试链接更换为 Https 协议 https://cp.cloudflare.com/generate_204
#### 🗑️ 移除内容
- 窗口状态管理器

View File

@@ -150,7 +150,7 @@ impl MihomoManager {
test_url: Option<String>,
timeout: i32,
) -> Result<serde_json::Value, String> {
let test_url = test_url.unwrap_or("https://www.gstatic.com/generate_204".to_string());
let test_url = test_url.unwrap_or("https://cp.cloudflare.com/generate_204".to_string());
let url = format!(
"{}/proxies/{}/delay?url={}&timeout={}",
self.mihomo_server, name, test_url, timeout

View File

@@ -454,7 +454,7 @@ export const GroupsEditorViewer = (props: Props) => {
<ListItemText primary={t("Health Check Url")} />
<TextField
autoComplete="new-password"
placeholder="https://www.gstatic.com/generate_204"
placeholder="https://cp.cloudflare.com/generate_204"
size="small"
sx={{ width: "calc(100% - 150px)" }}
{...field}

View File

@@ -216,7 +216,7 @@ export const MiscViewer = forwardRef<DialogRef>((props, ref) => {
spellCheck="false"
sx={{ width: 250, marginLeft: "auto" }}
value={values.defaultLatencyTest}
placeholder="https://www.gstatic.com/generate_204"
placeholder="https://cp.cloudflare.com/generate_204"
onChange={(e) =>
setValues((v) => ({ ...v, defaultLatencyTest: e.target.value }))
}

View File

@@ -83,7 +83,7 @@ export const getProxyDelay = async (
) => {
const params = {
timeout: timeout || 10000,
url: url || "https://www.gstatic.com/generate_204",
url: url || "https://cp.cloudflare.com/generate_204",
};
const instance = await getAxios();
const result = await instance.get(
@@ -274,7 +274,7 @@ export const getGroupProxyDelays = async (
) => {
const params = {
timeout: timeout || 10000,
url: url || "https://www.gstatic.com/generate_204",
url: url || "https://cp.cloudflare.com/generate_204",
};
console.log(

View File

@@ -183,7 +183,7 @@ export async function cmdGetProxyDelay(
url?: string,
) {
// 确保URL不为空
const testUrl = url || "https://www.gstatic.com/generate_204";
const testUrl = url || "https://cp.cloudflare.com/generate_204";
console.log(
`[API] 调用延迟测试API代理: ${name}, 超时: ${timeout}ms, URL: ${testUrl}`,
);

View File

@@ -23,7 +23,7 @@ class DelayManager {
`[DelayManager] 获取测试URL组: ${group}, URL: ${url || "未设置"}`,
);
// 如果未设置URL返回默认URL
return url || "https://www.gstatic.com/generate_204";
return url || "https://cp.cloudflare.com/generate_204";
}
setListener(name: string, group: string, listener: (time: number) => void) {