HTTP streaming connection (SSE) client disconnect not detected with Sinatra/Thin on Heroku HTTP streaming connection (SSE) client disconnect not detected with Sinatra/Thin on Heroku ruby ruby

HTTP streaming connection (SSE) client disconnect not detected with Sinatra/Thin on Heroku


An update: after working directly with the Heroku routing team (who are great guys!), this is now fixed in their new routing layer, and should work properly in any platform.


I would do this check by hand sending, in a periodic time, alive signal where the client should respond if the message was received.

Please, look at this simple chat implementation https://gist.github.com/tlewin/5708745 that illustrate this concept.

The application communicates with the client using a simple JSON protocol. When the client receive the alive: true message, the application post back a response and the server store the last communication time.