imanel/websocket-rack

Consider using thin-websocket...what is this?

scottmessinger opened this issue · 2 comments

Hi,

Thanks for producing this. I'm puzzled by this error message:

WARNING: You are using old EventMachine version. Please consider updating to EM version >= 1.0.0 or running Thin using thin-websocket.

I'm using the latest version of EM (0.12.10) and I can't find a gem called thin-websocket. Further, why would you call the current version of EM "old" and encourage updating to a version (>= 1.0.0) that hasn't been released yet?

I'd love to get this up and running--what can I do do make it work?

Thanks in advance!
Scott

First things first: why I'm calling EM v.0.12.10 old? Mostly because it has nearly two years and have major bugs that was fixed in new releases. EM 1.0.0.beta3 is pretty stable - a lot of users are running it and it works great. One of this bugs is preventing reset of connection timeout once it is set - and Thin is setting it at start to 30s. So after 30s of inactivity connection will be closed. To prevent that we need to set timeout to 0 - for newer versions of EM WS-Rack is setting this only for WS connections, but in old one we need to set it for all connections. And in order to do so we need to set one constant BEFORE Thin initializes. Thats why I created thin-websocket - wrapper that is doing so. It is installed at default so you just need to call thin using 'thin-websocket' instead of 'thin' command.

I hope this explains both why and how to run WebSocket-Rack :)

Best regards,
Bernard "Imanel" Potocki

Thanks for the super fast response!