feat(connection): enhance connection handling with SSH tunnel support

This commit is contained in:
t8y2
2026-04-30 16:07:26 +08:00
parent 5ee4f9300f
commit 4d8ae1221e
2 changed files with 161 additions and 68 deletions
+8
View File
@@ -79,6 +79,14 @@ impl TunnelManager {
Ok(local_port)
}
pub async fn local_port(&self, connection_id: &str) -> Option<u16> {
self.tunnels
.lock()
.await
.get(connection_id)
.map(|(_, port)| *port)
}
pub async fn stop_tunnel(&self, connection_id: &str) {
if let Some((mut child, _)) = self.tunnels.lock().await.remove(connection_id) {
let _ = child.kill().await;