Rainbows! Rack HTTP server user/dev discussion
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson-rMlxZR9MS24@public.gmane.org>
To: Rainbows! list <rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org>
Subject: Re: Websocket Handshake 76
Date: Wed, 7 Jul 2010 13:38:49 -0700	[thread overview]
Message-ID: <20100707203848.GA21844@dcvr.yhbt.net> (raw)
In-Reply-To: <20100707172640.26fe0ce8@wigowyr>

Niklas Hofer <niklas+rainbows-75qsND6Xt1xd/oRx+cCnAQ@public.gmane.org> wrote:
> 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?

Hi Niklas,

I haven't gotten a chance to look into the new WebSocket updates, but
can't you just read the 8 bytes off env["rack.input"]?

  env["rack.input"].read(8)

-- 
Eric Wong
_______________________________________________
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


  reply	other threads:[~2010-07-07 20:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-07 15:26 Websocket Handshake 76 Niklas Hofer
2010-07-07 20:38 ` Eric Wong [this message]
     [not found]   ` <20100707203848.GA21844-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2010-07-08 14:41     ` Niklas Hofer
2010-07-08 20:57       ` Eric Wong
     [not found]         ` <20100708205743.GB2991-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2010-07-08 22:07           ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/rainbows/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100707203848.GA21844@dcvr.yhbt.net \
    --to=normalperson-rmlxzr9ms24@public.gmane.org \
    --cc=rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/rainbows.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).