lib/arql/ssh_proxy.rb in arql-0.3.6 vs lib/arql/ssh_proxy.rb in arql-0.3.7
- old
+ new
@@ -6,12 +6,16 @@
class << self
attr_accessor :config, :ssh_gateway, :local_ssh_proxy_port
def connect(config)
+ print "Establishing SSH connection to #{config[:host]}:#{config[:port]}"
@config = config
@ssh_gateway = Net::SSH::Gateway.new(config[:host], config[:user], config.slice(:port, :password).symbolize_keys.merge(keepalive: true, keepalive_interval: 30, loop_wait: 1))
@local_ssh_proxy_port = @ssh_gateway.open(config[:forward_host], config[:forward_port], config[:local_port])
+ print "\u001b[2K"
+ puts "\rSSH connection to #{config[:host]}:#{config[:port]} established"
+ @local_ssh_proxy_port
end
def reconnect
reconnect! unless @ssh_gateway.active?
end