# File lib/net/ssh/service/forward.rb, line 165
    def remote(port, host, remote_port, remote_host="127.0.0.1")
      session.send_global_request("tcpip-forward", :string, remote_host, :long, remote_port) do |success, response|
        if success
          remote_port = response.read_long if remote_port == 0
          debug { "remote forward from remote #{remote_host}:#{remote_port} to #{host}:#{port} established" }
          @remote_forwarded_ports[[remote_port, remote_host]] = Remote.new(host, port)
          yield remote_port, remote_host if block_given?
        else
          instruction = if block_given?
            yield :error
          end
          unless instruction == :no_exception
            error { "remote forwarding request failed" }
            raise Net::SSH::Exception, "remote forwarding request failed"
          end
        end
      end
    end