klacke/yaws — pull request #99 by francois2metz (2012-03-16 11:11:02+00:00)
Title: Websocket open callback.

We can now pass some parameters when upgrading to websockets.

{websockets, CallbackMode, Opts, Params}

When the connection is upgraded, the websocket module now call:

CallbackMode:handle_message(open, Params)

Which allows you to keep some parameters from the initial request.
On the open callback, you can also send date over the connection.

handle_message(open, _Params) ->
yaws_api:websocket_send(self(), {text, <<"Hello world">>}).

TODO:

* handle compatibility with the previous implementation
* should we handle return value? Like {close, Reason}?
* update doc
* add tests
* gather feedback

It's just to start a discussion about #98.