# arirang ruby script example

require 'socket'
class Arirang

#@ari_port = 80

     def baedal
        ari_title   = "ruby socket code example\n"
        ari_desc    = "do not use this script on network scan\n"
        ari_desc   += "because did not support timeout in ruby code\n"
        ari_author  = "pilot <pilot@monkey.org>\n"

        puts "title: #{ari_title}"
        puts "desc: #{ari_desc}"
        puts "author: #{ari_author}"

     end

     def asadal
        addr = Socket.pack_sockaddr_in(80, $ari_host)
        s = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
        s.connect(addr)
        s.send("GET / HTTP/1.0\r\n\r\n", 0)
        puts s.recv(1000)
        s.close
    end

end