Use 127.0.0.1 for ssh tunnel

The previous 'localhost' value was causing connection problems on the
remote host, such that it would not create a connection through the
tunnel to the specified port.
This commit is contained in:
T. R. Bernstein
2025-08-29 23:51:23 +02:00
parent 95cbc62ef1
commit 2eed47d464

View File

@@ -26,10 +26,10 @@ class Kamal::Cli::PortForwarding
@threads = hosts.map do |host|
Thread.new do
Net::SSH.start(host, KAMAL.config.ssh.user) do |ssh|
ssh.forward.remote(port, "localhost", port, "localhost")
ssh.forward.remote(port, "127.0.0.1", port)
ssh.loop(0.1) do
if @done
ssh.forward.cancel_remote(port, "localhost")
ssh.forward.cancel_remote(port)
break
else
true