safer handle_intranet

This commit is contained in:
rustdesk
2024-03-23 00:56:18 +08:00
parent 83c45d772f
commit 1c3a2e475d
2 changed files with 35 additions and 14 deletions

View File

@@ -1011,6 +1011,11 @@ impl Config {
CONFIG2.read().unwrap().socks.clone()
}
#[inline]
pub fn is_proxy() -> bool {
Self::get_network_type() != NetworkType::Direct
}
pub fn get_network_type() -> NetworkType {
match &CONFIG2.read().unwrap().socks {
None => NetworkType::Direct,