diff --git a/src/main.rs b/src/main.rs index 17bcc76..de077b7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -913,7 +913,6 @@ async fn main() -> anyhow::Result<()> { } }); } - #[cfg(unix)] LocalProtocol::ReverseUnix { path } => { let path = path.clone(); tokio::spawn(async move { @@ -928,7 +927,7 @@ async fn main() -> anyhow::Result<()> { let (host, port) = to_host_port(tunnel.local); let remote = RemoteAddr { - protocol: LocalProtocol::ReverseUnix { path: path.clone() }, + protocol: LocalProtocol::ReverseUnix { path }, host, port, }; @@ -937,10 +936,6 @@ async fn main() -> anyhow::Result<()> { } }); } - #[cfg(not(unix))] - LocalProtocol::ReverseUnix { .. } => { - panic!("Unix socket is not available for non Unix platform") - } LocalProtocol::Stdio { .. } | LocalProtocol::TProxyTcp | LocalProtocol::TProxyUdp { .. } diff --git a/src/tunnel/server/server.rs b/src/tunnel/server/server.rs index e9f0d02..567c831 100644 --- a/src/tunnel/server/server.rs +++ b/src/tunnel/server/server.rs @@ -256,7 +256,7 @@ impl WsServer { let remote_port = find_mapped_port(remote.port, restriction); let local_srv = (remote.host, remote_port); let bind = try_to_sock_addr(local_srv.clone())?; - let listening_server = async { UnixTunnelListener::new(path, local_srv.clone(), false).await }; + let listening_server = async { UnixTunnelListener::new(path, local_srv, false).await }; let ((local_rx, local_tx), remote) = SERVERS.run_listening_server(bind, listening_server).await?; Ok((remote, Box::pin(local_rx), Box::pin(local_tx)))