Re: Trying to GET google with socket....problem
- From: Michael Gorsuch <michael.gorsuch@xxxxxxxxx>
- Date: Sun, 8 Apr 2007 05:39:25 +0900
I just ran this code in irb, and it worked without issue.
Can you provide the specific exception or unexpected results?
On Sun, Apr 08, 2007 at 05:28:07AM +0900, 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
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: Hey You
- Re: Trying to GET google with socket....problem
- References:
- Trying to GET google with socket....problem
- From: Hey You
- Trying to GET google with socket....problem
- Prev by Date: Re: rb_yield(), break, and C extensions
- Next by Date: Re: Trying to GET google with socket....problem
- Previous by thread: Trying to GET google with socket....problem
- Next by thread: Re: Trying to GET google with socket....problem
- Index(es):
Relevant Pages
|