celluloid/reel — pull request #17 by collin (2012-11-14 04:12:53+00:00)
Title: pass websockets through rack environment

Made some changes so that a WebSocket request will go through the RackWorker.

Extracted some methods for remote addr/remote host and uri parts (path/query/fragment) to modules so the could be re-used on WebSocket requests.

Right now it just sticks the WebSocket instance in the rack env at `env["async.connection"]` Not really ideal, but then nothing about mixing websockets and rack together is ideal.

Also on the negative side is things will be weird if some middleware depend on [status, headers, body].

Having implemented it, I'm not 100% convinced it's a worthy idea. But when hacking around with things it can be nice to pretend Rack and WebSockets can live together in harmony.