mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-04-16 23:40:32 +08:00
fix: avoid proxy in website tests when system proxy is off
This commit is contained in:
parent
b21bad334b
commit
0dcef80dc8
@ -120,13 +120,14 @@ pub async fn test_delay(url: String) -> anyhow::Result<u32> {
|
|||||||
let port = parsed.port().unwrap_or(if is_https { 443 } else { 80 });
|
let port = parsed.port().unwrap_or(if is_https { 443 } else { 80 });
|
||||||
|
|
||||||
let verge = Config::verge().await.latest_arc();
|
let verge = Config::verge().await.latest_arc();
|
||||||
let proxy_port = if verge.enable_tun_mode.unwrap_or(false) {
|
let proxy_enabled = verge.enable_system_proxy.unwrap_or(false) || verge.enable_tun_mode.unwrap_or(false);
|
||||||
None
|
let proxy_port = if proxy_enabled {
|
||||||
} else {
|
|
||||||
Some(match verge.verge_mixed_port {
|
Some(match verge.verge_mixed_port {
|
||||||
Some(p) => p,
|
Some(p) => p,
|
||||||
None => Config::clash().await.data_arc().get_mixed_port(),
|
None => Config::clash().await.data_arc().get_mixed_port(),
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
tokio::time::timeout(Duration::from_secs(10), async {
|
tokio::time::timeout(Duration::from_secs(10), async {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user