From 33a5fb88373493027bff6a42f5c75731dff3e153 Mon Sep 17 00:00:00 2001 From: GyDi Date: Wed, 26 Oct 2022 17:11:54 +0800 Subject: [PATCH] fix: add https proxy --- src-tauri/src/data/prfitem.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/data/prfitem.rs b/src-tauri/src/data/prfitem.rs index 73910e3..1331cf7 100644 --- a/src-tauri/src/data/prfitem.rs +++ b/src-tauri/src/data/prfitem.rs @@ -212,9 +212,16 @@ impl PrfItem { match Sysproxy::get_system_proxy() { Ok(p @ Sysproxy { enable: true, .. }) => { let proxy_scheme = format!("http://{}:{}", p.host, p.port); + if let Ok(proxy) = reqwest::Proxy::http(&proxy_scheme) { builder = builder.proxy(proxy); } + if let Ok(proxy) = reqwest::Proxy::https(&proxy_scheme) { + builder = builder.proxy(proxy); + } + if let Ok(proxy) = reqwest::Proxy::all(&proxy_scheme) { + builder = builder.proxy(proxy); + } } _ => {} }; @@ -233,7 +240,7 @@ impl PrfItem { let header = resp.headers(); - // parse the Subscription Userinfo + // parse the Subscription UserInfo let extra = match header.get("Subscription-Userinfo") { Some(value) => { let sub_info = value.to_str().unwrap_or("");