From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS14383 205.234.109.0/24 X-Spam-Status: No, score=0.0 required=3.0 tests=MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Niklas Hofer Newsgroups: gmane.comp.lang.ruby.rainbows.general Subject: Websocket Handshake 76 Date: Wed, 7 Jul 2010 17:26:40 +0200 Message-ID: <20100707172640.26fe0ce8@wigowyr> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1278517269 26126 80.91.229.12 (7 Jul 2010 15:41:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 7 Jul 2010 15:41:09 +0000 (UTC) To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Original-X-From: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Wed Jul 07 17:41:04 2010 Return-path: Envelope-to: gclrrg-rainbows-talk@m.gmane.org X-Original-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Delivered-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org X-Greylist: delayed 483 seconds by postgrey-1.31 at rubyforge.org; Wed, 07 Jul 2010 11:34:42 EDT X-Mailer: Claws Mail 3.7.4 (GTK+ 2.20.1; i486-pc-linux-gnu) X-BeenThere: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Errors-To: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Xref: news.gmane.org gmane.comp.lang.ruby.rainbows.general:93 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OWWkA-0001ZP-9s for gclrrg-rainbows-talk@m.gmane.org; Wed, 07 Jul 2010 17:41:02 +0200 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 7CAAC185834E; Wed, 7 Jul 2010 11:41:01 -0400 (EDT) Received: from soykaf.lanpartei.de (lanpartei.de [217.11.53.122]) by rubyforge.org (Postfix) with ESMTP id F08E618582EE for ; Wed, 7 Jul 2010 11:34:42 -0400 (EDT) Received: by soykaf.lanpartei.de (Postfix, from userid 8) id 4C45A6C8B7; Wed, 7 Jul 2010 17:41:57 +0200 (CEST) Received: from wigowyr (e179003174.adsl.alicedsl.de [85.179.3.174]) by soykaf.lanpartei.de (Postfix) with ESMTPSA id DC8B86C8B5 for ; Wed, 7 Jul 2010 17:41:51 +0200 (CEST) Hey I just tried to implement the new Websocket Handshake [1] into Rainbows/Sunshowers. I think I almost succeeded (tests and chrome passing), but I had to hack something and I want your opinion over it: In order to complete the new handshake, the server must use 8 bytes from the incoming body. Because Rainbows uses the HTTPParser and checking for the "Content-Length" field and the HTTP-like Websocket request does not supply such a field, no body is forwarded to the underlying app stack. (0.94.0: lib/rainbows/base.rb:72). My suggestion: Set an unused key in the env, for example 'hack.buf' and use this in lib/sunshowers/websocket.rb. Is this the right way (TM)? May there be a better name for the env key? with regards, Niklas [1] http://axod.blogspot.com/2010/06/websocket-gets-update-and-it-breaks.html -- _ o o | o > = o) /\ - = < (|/ | \|) \ (| | \ /) | (\ \ _ / / \ The game of life is a game of boomerangs. Our thoughts, deeds and words return to us sooner or later with astounding accuracy. _______________________________________________ Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org http://rubyforge.org/mailman/listinfo/rainbows-talk Do not quote signatures (like this one) or top post when replying