7

Currently im using private_pub + faye to have some basic streaming in Rails 4 project. Would it be possible to replace faye and private_pub and use Rails 4 streaming ( server send events instead ?)

Im just pushing data to the client and the client does not communicate back to the server for anything so it seems like it should be possible.

How does faye web sockets compare to rails 4 inside internet exploder browser? Is it compatible?

Rubytastic
  • 15,001
  • 18
  • 87
  • 175
  • 1
    It might be useful reading the answer from http://stackoverflow.com/questions/22158421/confusion-over-choosing-faye-or-rails-4-actioncontrollerlive/22758142#22758142 – Pierre Pretorius Apr 02 '14 at 22:22

1 Answers1

8

To run Rails 4 streaming you need at least Chrome 9+, Firefox 6.0+, Opera 11+, Safari 5+, iOS Safari 4.0+, Blackberry, Opera Mobile, Chrome for Android or Firefox for Android. For older versions of IE, you can use EventSource polyfill but one of the downsides of SSEs is that they do not support bi-directional communication.

Faye should run in any browser capable of one of the following:

  • WebSockets (including the Firefox 6 and Chrome 14 implementations as of 0.6.4)
  • XMLHttpRequest
  • CORS
  • JSON-P

Basically, the biggest diference between two solution is that Faye is based on Bayeux protocol, this means that the Faye should works in all browsers and servers that implements Bayeux protocol (currently Faye server implements Node.js and Ruby)

I think is better continue with private_pub and Faye because both are more stable and you can find more information about them on the internet.

I hope this helps.

danilodeveloper
  • 3,840
  • 2
  • 36
  • 56
  • Disagree on the private pub more stable its not maintained and SSE is a lot cleaner so I ended up implementing that. Upvote for the informative writeup on different technics – Rubytastic Nov 19 '13 at 18:57
  • The privatepub is no longer an active project however still rather stable and has many forks on github that are active. Anyway, thanks for the upvote ;) – danilodeveloper Nov 20 '13 at 13:25