fix(#333): Reverse Unix socket is now available for non Unix client
This commit is contained in:
parent
f55643550b
commit
74434da624
2 changed files with 2 additions and 7 deletions
|
@ -913,7 +913,6 @@ async fn main() -> anyhow::Result<()> {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
#[cfg(unix)]
|
|
||||||
LocalProtocol::ReverseUnix { path } => {
|
LocalProtocol::ReverseUnix { path } => {
|
||||||
let path = path.clone();
|
let path = path.clone();
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
|
@ -928,7 +927,7 @@ async fn main() -> anyhow::Result<()> {
|
||||||
|
|
||||||
let (host, port) = to_host_port(tunnel.local);
|
let (host, port) = to_host_port(tunnel.local);
|
||||||
let remote = RemoteAddr {
|
let remote = RemoteAddr {
|
||||||
protocol: LocalProtocol::ReverseUnix { path: path.clone() },
|
protocol: LocalProtocol::ReverseUnix { path },
|
||||||
host,
|
host,
|
||||||
port,
|
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::Stdio { .. }
|
||||||
| LocalProtocol::TProxyTcp
|
| LocalProtocol::TProxyTcp
|
||||||
| LocalProtocol::TProxyUdp { .. }
|
| LocalProtocol::TProxyUdp { .. }
|
||||||
|
|
|
@ -256,7 +256,7 @@ impl WsServer {
|
||||||
let remote_port = find_mapped_port(remote.port, restriction);
|
let remote_port = find_mapped_port(remote.port, restriction);
|
||||||
let local_srv = (remote.host, remote_port);
|
let local_srv = (remote.host, remote_port);
|
||||||
let bind = try_to_sock_addr(local_srv.clone())?;
|
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?;
|
let ((local_rx, local_tx), remote) = SERVERS.run_listening_server(bind, listening_server).await?;
|
||||||
|
|
||||||
Ok((remote, Box::pin(local_rx), Box::pin(local_tx)))
|
Ok((remote, Box::pin(local_rx), Box::pin(local_tx)))
|
||||||
|
|
Loading…
Reference in a new issue