I have a Rails 3 web application which needs to:
- retrieve a stream data from an external service using a TCP connection
- ensure the user is authorized to view the data (In my rails app I use devise and cancan)
- forward the data to the client using WebSockets.
There could be many clients wanting to look at one stream of data so it would be good if the web app could simply broadcast the stream to the clients.
I’ve come across following technologies which might be useful:
I want to know if I’m on the right track, and hear any other advice you have. Perhaps I need to make another Ruby app which runs in parallel to the Rails app?
I ended up using EventMachine + em-websocket. Peepcode has a few really comprehensive tutorials which helped get me started.