From 62545b985f274b4d2f6edc9004fca605716e6047 Mon Sep 17 00:00:00 2001 From: Cole Miller Date: Mon, 26 May 2025 21:18:10 -0400 Subject: [PATCH] debugger: Fix wrong port used for SSH debugging (#31474) We were trying to connect on the user's machine to the port number used by the debugger on the remote machine, instead of the randomly-assigned local available port. Release Notes: - Debugger Beta: Fixed a bug that caused connecting to a debug adapter over SSH to hang. --- crates/project/src/debugger/dap_store.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/project/src/debugger/dap_store.rs b/crates/project/src/debugger/dap_store.rs index 320df922c8e5953a3a423bf34f92431d7a04ec58..d182af629660141612e772f148419ac1fb0f15cc 100644 --- a/crates/project/src/debugger/dap_store.rs +++ b/crates/project/src/debugger/dap_store.rs @@ -240,13 +240,13 @@ impl DapStore { let mut connection = None; if let Some(c) = binary.connection { - let local_bind_addr = Ipv4Addr::new(127, 0, 0, 1); + let local_bind_addr = Ipv4Addr::LOCALHOST; let port = dap::transport::TcpTransport::unused_port(local_bind_addr).await?; ssh_command.add_port_forwarding(port, c.host.to_string(), c.port); connection = Some(TcpArguments { - port: c.port, + port, host: local_bind_addr, timeout: c.timeout, })