Ruby 连接到 Ruby的Web服务器 2015/10/26 15589 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