j2labs/brubeck — pull request #60 by stuntgoat (2012-04-05 05:58:18+00:00)
Title: add websocket demo

The websocket method was added to MessageHandler, which is overridden in the demo's request handler.

It seems to me that Brubeck application architects are responsible for managing the state of the connection. I am using ws4py to format the websocket frame for the demo but I could have just as easily used Autobahn. I don't keep the connection open; Mongrel2 times out if no message is sent from the client to the server after a while.

I am curious how you would handle maintaining the connection to the client in any Brubeck modules. Related to keeping the connection open, there is a discussion here:

http://www.ietf.org/mail-archive/web/hybi/current/msg09540.html

What I gather from the above conversation, it seems that people are still considering the best practice to keep the connection alive (and in a 'low latency' state, concerning mobile devices). In the mean time it would seem to be application specific.

From what I read in the RFC, the server-side requirements are handled for us by Mongrel2.
http://tools.ietf.org/html/rfc6455#section-4.2

Best,
Isaac