Ruby 连接到 Ruby的Web服务器

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

require 'socket'
socket = TCPSocket.new("www.ruby-lang.org", 80)
socket.puts "GET /en/index.html"
while (line = socket.gets)
    puts line
end
socket.close