Trying to GET google with socket....problem
- From: Hey You <r3madi@xxxxxxxxx>
- Date: Sun, 8 Apr 2007 05:28:07 +0900
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/.
.
- Follow-Ups:
- Re: Trying to GET google with socket....problem
- From: Brian Candler
- Re: Trying to GET google with socket....problem
- From: Ryan Davis
- Re: Trying to GET google with socket....problem
- From: Michael Gorsuch
- Re: Trying to GET google with socket....problem
- From: Michael Gorsuch
- Re: Trying to GET google with socket....problem
- Prev by Date: Re: listning to port 80 ?
- Next by Date: Re: Method constant arguments
- Previous by thread: Can a TkVariable store a symbol?
- Next by thread: Re: Trying to GET google with socket....problem
- Index(es):
Relevant Pages
|