mirror of
https://github.com/bolucat/Archive.git
synced 2025-10-29 02:52:47 +08:00
Update On Sat Apr 19 20:35:22 CEST 2025
This commit is contained in:
@@ -95,6 +95,19 @@ impl MihomoManager {
|
||||
self.update_providers_proxies(providers_proxies);
|
||||
Ok(self)
|
||||
}
|
||||
|
||||
pub async fn close_all_connections(&self) -> Result<(), String> {
|
||||
let url = format!("{}/connections", self.mihomo_server);
|
||||
let response = self.send_request(Method::DELETE, url, None).await?;
|
||||
if response["code"] == 204 {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(response["message"]
|
||||
.as_str()
|
||||
.unwrap_or("unknown error")
|
||||
.to_string())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl MihomoManager {
|
||||
|
||||
Reference in New Issue
Block a user