From: Ryan Davis Date: 2007-04-08T05:41:51+09:00 Subject: Re: Trying to GET google with socket....problem On Apr 7, 2007, at 13:28 , Hey You wrote: > Well I don't know why the socket can't connect to Google. Here is my > source code: > > require 'socket' > h = TCPSocket.new('www.google.ca',80) > h.print "GET /index.html HTTP/1.0\n\n" > a = h.read > puts a If you just want to get google (or whatever), use: ruby -ropen-uri -e 'puts URI.parse("http://www.google.com/ index.html").read' If you want to know the inner-workings of HTTP clients and servers, use the above and trace it backwards. There is a lot of good code in there.