fix(#333): Reverse Unix socket is now available for non Unix client

This commit is contained in:
Σrebe - Romain GERARD 2024-08-15 09:48:14 +02:00
parent f55643550b
commit 74434da624
No known key found for this signature in database
GPG key ID: 7A42B4B97E0332F4
2 changed files with 2 additions and 7 deletions

View file

@ -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 { .. }

View file

@ -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)))