From 2eed47d464b43c22fd514d415b13e8e6a5584139 Mon Sep 17 00:00:00 2001 From: "T. R. Bernstein" <137705289+trbernstein@users.noreply.github.com> Date: Fri, 29 Aug 2025 23:51:23 +0200 Subject: [PATCH] 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. --- lib/kamal/cli/port_forwarding.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/kamal/cli/port_forwarding.rb b/lib/kamal/cli/port_forwarding.rb index 7465795a..7664d667 100644 --- a/lib/kamal/cli/port_forwarding.rb +++ b/lib/kamal/cli/port_forwarding.rb @@ -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