class Net::SSH::Transport::Session

def peer

including :ip, :port, :host, and :canonized (see #host_as_string).
Returns a hash of information about the peer (remote) side of the socket,
def peer
  @peer ||= { ip: socket.peer_ip, port: @port.to_i, host: @host, canonized: host_as_string }
end