Skip to content

Commit a28c857

Browse files
committed
remove check for system proxy on startup
1 parent 06857f4 commit a28c857

2 files changed

Lines changed: 1 addition & 31 deletions

File tree

src/bin/ui.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use mhrv_rs::domain_fronter::{DomainFronter, DEFAULT_GOOGLE_SNI_POOL};
1616
use mhrv_rs::lan_utils::{detect_lan_ip, is_share_on_lan};
1717
use mhrv_rs::mitm::{MitmCertManager, CA_CERT_FILE};
1818
use mhrv_rs::proxy_server::ProxyServer;
19-
use mhrv_rs::system_proxy::{check_system_proxy, disable_system_proxy, enable_system_proxy};
19+
use mhrv_rs::system_proxy::{disable_system_proxy, enable_system_proxy};
2020
use mhrv_rs::{scan_ips, scan_sni, test_cmd};
2121

2222
const VERSION: &str = env!("CARGO_PKG_VERSION");
@@ -33,14 +33,6 @@ fn main() -> eframe::Result<()> {
3333
mhrv_rs::rlimit::raise_nofile_limit_best_effort();
3434

3535
let shared = Arc::new(Shared::default());
36-
37-
let system_proxy = check_system_proxy().unwrap_or_else(|_| {
38-
push_log(&shared, "failed to read system proxy...");
39-
false
40-
});
41-
42-
shared.state.lock().unwrap().system_proxy = system_proxy;
43-
4436
let (cmd_tx, cmd_rx) = std::sync::mpsc::channel::<Cmd>();
4537

4638
// Load the user's saved form first so we can seed the tracing filter

src/system_proxy.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,6 @@ use crate::config::Config;
77
const LINUX_SCRIPT: &str = include_str!("../scripts/proxy_set_linux_sh");
88
const MACOS_SCRIPT: &str = include_str!("../scripts/proxy_set_osx_sh");
99

10-
pub fn check_system_proxy() -> std::io::Result<bool> {
11-
#[cfg(target_os = "windows")]
12-
{
13-
let hkcu = winreg::RegKey::predef(winreg::enums::HKEY_CURRENT_USER);
14-
let internet_settings = hkcu.open_subkey_with_flags(
15-
"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",
16-
winreg::enums::KEY_QUERY_VALUE,
17-
)?;
18-
let enabled: u32 = internet_settings.get_value("ProxyEnable")?;
19-
20-
Ok(enabled != 0)
21-
}
22-
#[cfg(target_os = "macos")]
23-
{
24-
let res = run_script(MACOS_SCRIPT, &["check"]);
25-
match res {
26-
Ok(()) => Ok(true),
27-
Err(_) => Ok(false),
28-
}
29-
}
30-
}
31-
3210
pub fn enable_system_proxy(cfg: &Config) -> Result<(), Error> {
3311
#[cfg(target_os = "windows")]
3412
{

0 commit comments

Comments
 (0)