# arirang ruby script example
# export PROXY_TYPE="RELAY"
# required the -X option
# eg) arirang -X yourproxy:3128 -R server_relay.rb -h yourhost
class Arirang

#@ari_port = 80
#@ari_recvsize = 1024
#@ari_recvflag = 3

     def baedal
        $ari_info = {
        'description' => '-G option to arirang ruby script',
        'author' => 'pilot pilot@monkey.org'
        }
        puts $ari_info['description'] + "\n\n" 
     end

     def asadal
         ariconnect
         extra = "GET http://#{$ari_host}/ HTTP/1.0\r\n\r\n"
         response = arisend(extra)
         response.each_line do |line|
         x = line.match(/^Server\: (.+)\r/)
            if x != nil
                y = "#{$ari_host} - #{$ari_sport}/tcp - #{x[1]}\n"
                ariprint(y)
            end
         end
     end

end

