Optimize HTTP calls
This commit is contained in:
@@ -801,6 +801,10 @@ pub fn main_set_socks(proxy: String, username: String, password: String) {
|
||||
set_socks(proxy, username, password)
|
||||
}
|
||||
|
||||
pub fn main_get_proxy_status() -> bool {
|
||||
get_proxy_status()
|
||||
}
|
||||
|
||||
pub fn main_get_socks() -> Vec<String> {
|
||||
get_socks()
|
||||
}
|
||||
|
||||
@@ -895,6 +895,9 @@ pub async fn set_socks(value: config::Socks5Server) -> ResultType<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn get_proxy_status() -> bool {
|
||||
Config::get_socks().is_some()
|
||||
}
|
||||
#[tokio::main(flavor = "current_thread")]
|
||||
pub async fn test_rendezvous_server() -> ResultType<()> {
|
||||
let mut c = connect(1000, "").await?;
|
||||
|
||||
@@ -421,6 +421,14 @@ pub fn set_socks(proxy: String, username: String, password: String) {
|
||||
.ok();
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get_proxy_status() -> bool {
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
return ipc::get_proxy_status();
|
||||
#[cfg(any(target_os = "android", target_os = "ios"))]
|
||||
return false;
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "android", target_os = "ios"))]
|
||||
pub fn set_socks(_: String, _: String, _: String) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user