I’m using Ruby,
It’s based on an a custom implementation ; nothing fancy just an EventMachine::HttpRequest, plus few convenient ‘middleware’ EventMachine::Middleware::JSONResponse & EventMachine::Middleware::OAuth.
So I got the raw stream (as a string which I chunk myself). I got all other messages like disconnect, rate limit etc…
Here is a pseudo code (only the important parts) : https://gist.github.com/mfo/d4b59d66d7ef626f2a62685d9a4520dd