Trying to GET google with socket....problem



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

I tried changing the HTTP to 1.1 but it still doesn't work.

--
Posted via http://www.ruby-forum.com/.

.



Relevant Pages

  • Re: Trying to GET google with socket....problem
    ... can you provide the platform that you are using? ... require 'socket' ...
    (comp.lang.ruby)
  • Re: Help please with 12S plug
    ... I am a great fan of Google and can find almost anything there. ... went to Google and after typing in "12S socket" and clicking for UK only I ... and got badly scuffed, needing replacement. ...
    (uk.rec.caravanning)
  • Re: Help please with 12S plug
    ... I too use the Internet, and Google a lot, but I still ... went to Google and after typing in "12S socket" and clicking for UK only I ... and got badly scuffed, needing replacement. ...
    (uk.rec.caravanning)
  • Re: 1.7GHz 486??
    ... The Cyrix 6x86 performance ratings were labelled PR, ... > were socket 7 processors. ... Just Google it e.g. ...
    (uk.comp.homebuilt)
  • Re: How can a new process use a used port?
    ... > sounds like the filedescriptor was passed over a socket from the ... > real listening daemon. ... here's one explanation a quick search with Google found: ...
    (comp.unix.solaris)