ysbaddaden/sinapse — pull request #9 by ysbaddaden (2014-05-14 22:05:32+00:00)
Title: Experimental support for WebSockets

Allows to connect using a WebSocket instead of EventSource (refs #4)

**Authentication**

Sends a JSON encoded text frame on success, or just closes the connection on error (eg: wrong access_token or empty channels list):

```json
{ "event": "authentication", "data": "ok" }
```

Maybe it should return an authentication method "ko" instead of just closing? Or maybe just fail the handshake by returning a 401 http status?

**Messages**

Messages are sent as is unless an event is specified (either the channel name or when publishing) in which case it's a JSON encoded text frame:

```json
{ "event": "message:create", "data": "my message" }
```

Maybe it would be better to always send the JSON text frame, with a default `message` event type?