fix: add async http proxy func and format the code

This commit is contained in:
yuluo
2024-04-16 00:24:02 +08:00
parent c3b8621554
commit 1176750a4f
12 changed files with 232 additions and 174 deletions

View File

@@ -1,9 +1,11 @@
use super::*;
use crate::hbbs_http::create_http_client;
use crate::{
flutter::{self, APP_TYPE_CM, APP_TYPE_MAIN, SESSIONS},
ui_interface::get_api_server,
};
use hbb_common::{lazy_static, log, message_proto::PluginRequest};
use reqwest::blocking::Client;
use serde_derive::{Deserialize, Serialize};
use serde_json;
use std::{
@@ -13,8 +15,6 @@ use std::{
thread,
time::Duration,
};
use reqwest::blocking::Client;
use crate::hbbs_http::create_client;
const MSG_TO_RUSTDESK_TARGET: &str = "rustdesk";
const MSG_TO_PEER_TARGET: &str = "peer";
@@ -282,7 +282,7 @@ fn request_plugin_sign(id: String, msg_to_rustdesk: MsgToRustDesk) -> PluginRetu
);
thread::spawn(move || {
let sign_url = format!("{}/lic/web/api/plugin-sign", get_api_server());
let client = create_client().unwrap_or(Client::new());
let client = create_http_client();
let req = PluginSignReq {
plugin_id: id.clone(),
version: signature_data.version,