garyburd/twitterstream — pull request #3 by alltom (2014-01-27 18:04:02+00:00)
Title: Rely on net/http for reading chunked HTTP. Use \r instead of \n as the tweet delimiter.

Caveat: I didn't see a way to add the 60-second read timeouts. I left the old timeouts there, but commented them out.

A few weeks ago my server was emitting tens of thousands of errors when somehow twitterstream was losing track of where it was in the stream. After restarting the server half a dozen times, I took the HTTP parsing out of twitterstream. My server has been running since then with no problems.

Also, Twitter doesn't guarantee tweets won't contain `\n`, but it does guarantee they won't contain `\r`, so I modified the library to look for the delimiter `\r` instead. https://dev.twitter.com/docs/streaming-apis/processing#Parsing_responses