Websocket Handshake 76
normalperson at yhbt.net
Wed Jul 7 16:38:49 EDT 2010
Niklas Hofer <niklas+rainbows at lanpartei.de> wrote:
> I just tried to implement the new Websocket Handshake  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?
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"]?
More information about the rainbows-talk