feat: separate zstd and faketcp into features (#1861)

* feat: separate faketcp into a feature
* fix: no need to initialize out_len
* feat: separate zstd into a feature
* clippy: remove unnecessary cast, because for unix size_t always equals usize
This commit is contained in:
Chenx Dust
2026-02-03 11:12:33 +08:00
committed by GitHub
parent 7750e81168
commit e1cbd07d1f
8 changed files with 79 additions and 23 deletions
+5 -2
View File
@@ -9,6 +9,8 @@ use anyhow::Context;
use async_trait::async_trait;
use tokio::task::JoinSet;
#[cfg(feature = "faketcp")]
use crate::tunnel::fake_tcp::FakeTcpTunnelListener;
#[cfg(feature = "quic")]
use crate::tunnel::quic::QUICTunnelListener;
#[cfg(feature = "wireguard")]
@@ -21,8 +23,8 @@ use crate::{
},
peers::peer_manager::PeerManager,
tunnel::{
fake_tcp::FakeTcpTunnelListener, ring::RingTunnelListener, tcp::TcpTunnelListener,
udp::UdpTunnelListener, Tunnel, TunnelListener,
ring::RingTunnelListener, tcp::TcpTunnelListener, udp::UdpTunnelListener, Tunnel,
TunnelListener,
},
};
@@ -49,6 +51,7 @@ pub fn get_listener_by_url(
use crate::tunnel::websocket::WSTunnelListener;
Box::new(WSTunnelListener::new(l.clone()))
}
#[cfg(feature = "faketcp")]
"faketcp" => Box::new(FakeTcpTunnelListener::new(l.clone())),
#[cfg(unix)]
"unix" => {