File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ use mhrv_rs::domain_fronter::{DomainFronter, DEFAULT_GOOGLE_SNI_POOL};
1616use mhrv_rs:: lan_utils:: { detect_lan_ip, is_share_on_lan} ;
1717use mhrv_rs:: mitm:: { MitmCertManager , CA_CERT_FILE } ;
1818use 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} ;
2020use mhrv_rs:: { scan_ips, scan_sni, test_cmd} ;
2121
2222const 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
Original file line number Diff line number Diff line change @@ -7,28 +7,6 @@ use crate::config::Config;
77const LINUX_SCRIPT : & str = include_str ! ( "../scripts/proxy_set_linux_sh" ) ;
88const 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-
3210pub fn enable_system_proxy ( cfg : & Config ) -> Result < ( ) , Error > {
3311 #[ cfg( target_os = "windows" ) ]
3412 {
You can’t perform that action at this time.
0 commit comments