mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 08:45:41 +08:00
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:
4
.github/workflows/autobuild.yml
vendored
4
.github/workflows/autobuild.yml
vendored
@@ -424,9 +424,7 @@ jobs:
|
|||||||
|
|
||||||
autobuild-x86-arm-windows_webview2:
|
autobuild-x86-arm-windows_webview2:
|
||||||
name: Autobuild x86 and ARM Windows with WebView2
|
name: Autobuild x86 and ARM Windows with WebView2
|
||||||
needs: check_commit
|
needs: update_tag
|
||||||
if: ${{ needs.check_commit.outputs.should_run == 'true' }}
|
|
||||||
# needs: update_tag
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
@@ -88,7 +88,7 @@
|
|||||||
- 配置文件缺失 secret 字段时自动填充默认值 set-your-secret
|
- 配置文件缺失 secret 字段时自动填充默认值 set-your-secret
|
||||||
- 优化异步处理,防止部分组件 UI 阻塞
|
- 优化异步处理,防止部分组件 UI 阻塞
|
||||||
- 关闭 DNS 启用
|
- 关闭 DNS 启用
|
||||||
- 延迟测试链接更换为 Https 协议 https://www.gstatic.com/generate_204
|
- 延迟测试链接更换为 Https 协议 https://cp.cloudflare.com/generate_204
|
||||||
|
|
||||||
#### 🗑️ 移除内容
|
#### 🗑️ 移除内容
|
||||||
- 窗口状态管理器
|
- 窗口状态管理器
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ impl MihomoManager {
|
|||||||
test_url: Option<String>,
|
test_url: Option<String>,
|
||||||
timeout: i32,
|
timeout: i32,
|
||||||
) -> Result<serde_json::Value, String> {
|
) -> 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!(
|
let url = format!(
|
||||||
"{}/proxies/{}/delay?url={}&timeout={}",
|
"{}/proxies/{}/delay?url={}&timeout={}",
|
||||||
self.mihomo_server, name, test_url, timeout
|
self.mihomo_server, name, test_url, timeout
|
||||||
|
|||||||
@@ -454,7 +454,7 @@ export const GroupsEditorViewer = (props: Props) => {
|
|||||||
<ListItemText primary={t("Health Check Url")} />
|
<ListItemText primary={t("Health Check Url")} />
|
||||||
<TextField
|
<TextField
|
||||||
autoComplete="new-password"
|
autoComplete="new-password"
|
||||||
placeholder="https://www.gstatic.com/generate_204"
|
placeholder="https://cp.cloudflare.com/generate_204"
|
||||||
size="small"
|
size="small"
|
||||||
sx={{ width: "calc(100% - 150px)" }}
|
sx={{ width: "calc(100% - 150px)" }}
|
||||||
{...field}
|
{...field}
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ export const MiscViewer = forwardRef<DialogRef>((props, ref) => {
|
|||||||
spellCheck="false"
|
spellCheck="false"
|
||||||
sx={{ width: 250, marginLeft: "auto" }}
|
sx={{ width: 250, marginLeft: "auto" }}
|
||||||
value={values.defaultLatencyTest}
|
value={values.defaultLatencyTest}
|
||||||
placeholder="https://www.gstatic.com/generate_204"
|
placeholder="https://cp.cloudflare.com/generate_204"
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
setValues((v) => ({ ...v, defaultLatencyTest: e.target.value }))
|
setValues((v) => ({ ...v, defaultLatencyTest: e.target.value }))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ export const getProxyDelay = async (
|
|||||||
) => {
|
) => {
|
||||||
const params = {
|
const params = {
|
||||||
timeout: timeout || 10000,
|
timeout: timeout || 10000,
|
||||||
url: url || "https://www.gstatic.com/generate_204",
|
url: url || "https://cp.cloudflare.com/generate_204",
|
||||||
};
|
};
|
||||||
const instance = await getAxios();
|
const instance = await getAxios();
|
||||||
const result = await instance.get(
|
const result = await instance.get(
|
||||||
@@ -274,7 +274,7 @@ export const getGroupProxyDelays = async (
|
|||||||
) => {
|
) => {
|
||||||
const params = {
|
const params = {
|
||||||
timeout: timeout || 10000,
|
timeout: timeout || 10000,
|
||||||
url: url || "https://www.gstatic.com/generate_204",
|
url: url || "https://cp.cloudflare.com/generate_204",
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ export async function cmdGetProxyDelay(
|
|||||||
url?: string,
|
url?: string,
|
||||||
) {
|
) {
|
||||||
// 确保URL不为空
|
// 确保URL不为空
|
||||||
const testUrl = url || "https://www.gstatic.com/generate_204";
|
const testUrl = url || "https://cp.cloudflare.com/generate_204";
|
||||||
console.log(
|
console.log(
|
||||||
`[API] 调用延迟测试API,代理: ${name}, 超时: ${timeout}ms, URL: ${testUrl}`,
|
`[API] 调用延迟测试API,代理: ${name}, 超时: ${timeout}ms, URL: ${testUrl}`,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class DelayManager {
|
|||||||
`[DelayManager] 获取测试URL,组: ${group}, URL: ${url || "未设置"}`,
|
`[DelayManager] 获取测试URL,组: ${group}, URL: ${url || "未设置"}`,
|
||||||
);
|
);
|
||||||
// 如果未设置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) {
|
setListener(name: string, group: string, listener: (time: number) => void) {
|
||||||
|
|||||||
Reference in New Issue
Block a user