support no tun mode (#141)

This commit is contained in:
Sijie.Sun
2024-06-10 10:27:24 +08:00
committed by GitHub
parent fede35cca4
commit 8aa57ebc22
21 changed files with 1722 additions and 170 deletions
+7
View File
@@ -65,6 +65,7 @@ pub struct GlobalCtx {
running_listeners: Mutex<Vec<url::Url>>,
enable_exit_node: bool,
no_tun: bool,
}
impl std::fmt::Debug for GlobalCtx {
@@ -93,6 +94,7 @@ impl GlobalCtx {
let stun_info_collection = Arc::new(StunInfoCollector::new_with_default_servers());
let enable_exit_node = config_fs.get_flags().enable_exit_node;
let no_tun = config_fs.get_flags().no_tun;
GlobalCtx {
inst_name: config_fs.get_inst_name(),
@@ -114,6 +116,7 @@ impl GlobalCtx {
running_listeners: Mutex::new(Vec::new()),
enable_exit_node,
no_tun,
}
}
@@ -234,6 +237,10 @@ impl GlobalCtx {
pub fn enable_exit_node(&self) -> bool {
self.enable_exit_node
}
pub fn no_tun(&self) -> bool {
self.no_tun
}
}
#[cfg(test)]