mirror of
https://mirror.suhoan.cn/https://github.com/EasyTier/EasyTier.git
synced 2025-12-12 12:47:25 +08:00
feat: allow using --proxy-forward-by-system together with --enable-exit-node (#957)
This commit is contained in:
@@ -71,7 +71,6 @@ impl IpProxy {
|
||||
|
||||
async fn start(&self) -> Result<(), Error> {
|
||||
if (self.global_ctx.get_proxy_cidrs().is_empty()
|
||||
|| self.global_ctx.proxy_forward_by_system()
|
||||
|| self.started.load(Ordering::Relaxed))
|
||||
&& !self.global_ctx.enable_exit_node()
|
||||
&& !self.global_ctx.no_tun()
|
||||
@@ -79,6 +78,13 @@ impl IpProxy {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
// Actually, if this node is enabled as an exit node,
|
||||
// we still can use the system stack to forward packets.
|
||||
if self.global_ctx.proxy_forward_by_system()
|
||||
&& !self.global_ctx.no_tun() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
self.started.store(true, Ordering::Relaxed);
|
||||
self.tcp_proxy.start(true).await?;
|
||||
if let Err(e) = self.icmp_proxy.start().await {
|
||||
|
||||
Reference in New Issue
Block a user