mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 02:09:06 +00: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> {
|
async fn start(&self) -> Result<(), Error> {
|
||||||
if (self.global_ctx.get_proxy_cidrs().is_empty()
|
if (self.global_ctx.get_proxy_cidrs().is_empty()
|
||||||
|| self.global_ctx.proxy_forward_by_system()
|
|
||||||
|| self.started.load(Ordering::Relaxed))
|
|| self.started.load(Ordering::Relaxed))
|
||||||
&& !self.global_ctx.enable_exit_node()
|
&& !self.global_ctx.enable_exit_node()
|
||||||
&& !self.global_ctx.no_tun()
|
&& !self.global_ctx.no_tun()
|
||||||
@@ -79,6 +78,13 @@ impl IpProxy {
|
|||||||
return Ok(());
|
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.started.store(true, Ordering::Relaxed);
|
||||||
self.tcp_proxy.start(true).await?;
|
self.tcp_proxy.start(true).await?;
|
||||||
if let Err(e) = self.icmp_proxy.start().await {
|
if let Err(e) = self.icmp_proxy.start().await {
|
||||||
|
|||||||
Reference in New Issue
Block a user