Rails and Websocket - ruby-on-rails

So I want to be able to get a live stream of notifications for my users that are using my rails application. I heard that you are able to do this using web sockets but I haven't seen anything about it in rails.
Is there a way to do this in rails or am I able to use something else along side my application such as node.js ?

Okay I started searching for different terms and I was able to find Faye
This tutorial is great for it http://code.tutsplus.com/tutorials/how-to-use-faye-as-a-real-time-push-server-in-rails--net-22600

You can also use something like PubNub http://www.pubnub.com/
They support a good amount of languages/libraries such as AngularJS. Great customer service and documentation. Also many examples such as this one: http://www.pubnub.com/developers/data-streams/twitter-stream

Related

User authentication between a rails api and a node.js app

I am attempting to understand how segmented apps work so I'm building one that uses rails for the back-end api and node.js for the front and middle. What I am trying to figure out is how to let a user log in through rails and use that same session information in the node app.
I have heard of oauth2, but I don't know if that's what I need or if I need something else. My main concern is that I want to keep all the models in the rails app so I can take advantage of the syntactic sugar and associations that rails provides. The node app will just connect to the rails app through it's api.
Are there any tutorials out there for this? Or does anyone know how I can do it?
Found my answer here. Hope it can help someone else out

rails real-time application

I am building a real-time application ,and I am using private_pub gem based on fayejs
but it doesn't have a lot of features like pusher ex. presence channels which I can fetch online users
for me pusher is expensive for my application
I read some posts about socket.io but I didn't know how to implement it with rails and also if I need to learn node.js before using it
hope any one could help me
I do not know why exactly it is expensive for your application but I have never found any problem.
Please refer this link.
http://net.tutsplus.com/tutorials/ruby/how-to-use-faye-as-a-real-time-push-server-in-rails/

instant messenger implementation for rails?

I have searched for some time investigating several technologies to build an simple instant messaging system for a ruby on rails app. It seems very complicated as I haven't found any implementations that are cross browser or any 1-1 proof of concept at all.
Looked into:
xmpp clients ( there is Candy on github only supports group chat )
xmpp servers & Rails ( lot of hassle no good integration )
Juggernaut ( no 1-1 , not supported by Internet Explorer cause of web sockets used)
Private Pub by ryan bates ( seems to be able to do the trick but as ruby newbie with little documentation on this cannot get this figured )
Can anyone suggest me a instant messenger for rails:
that is Cross browser
has good documentation, example of implementation
Instant Messenger where User A talks to User B and User B talks to User A
I really have no idea anymore how I would implement this, anyone can give me advise on how this problem could be tackled? thx
As Eric said, there isn't one. Messaging is a very difficult thing to do.
Right now I'm using Pubnub, which is an external service. There isn't very good documentation on Rails integration, so you'll just have to try to do it yourself.
On the better documented side, there's Faye, but this is an internal process and requires two instances to be running (one to respond to Faye requests, and one to run your app). This was a little trickier (and more expensive) to do on Heroku, so I just stuck to Pubnub.
In terms of Faye documentation, check out this Railscast, and for privacy, check out Private Pub.
edit: if you think Private Pub is hard to integrate.. well, not to be mean, but perhaps you should try to learn more about Rails and Javascript before you delve into this matter, as it's not an easy thing to do (even though it seems like it should be)
edit 2: Also, for faye, this tutorial might help you out.
You might be better off using Node.js for this type of thing.
Work in progress:
full facebook clone
https://github.com/rubytastic/im
please contribute the code is to be fixed and still wacky!

trouble using juggernaut as a rails plugin

i am developing a rails plugin, in which i want a model where server will notify updates to all the connected clients. for simplicity say, on certain event server will say 'hi there is an update' to all the clients.
i came across juggernaut plugin that uses web-sockets and have followed https://github.com/maccman/juggernaut_plugin/tree/c3e07a812341f93bb1f90c00b7a125524b07b80a
but its not working for me.
can any one help me figuring out what am i missing, simply to send an alerts to the clients.
or is there some simpler library or simpler way to get on with it?
any suggestions/comments will be appreciated.
What about Faye? Here's a Railscasts screencast
juggernaut_plugin hasn't been updated for three years. You want Juggernaut, the much more recently and recently-updated version. Try following the instructions for that.

Web App that uses Webcam...any Rails plugins/gems?

I;m a developer looking to make an app similar to chat roulette. I'm pretty comfortable with Ruby on Rails as my platform and would like to program it in that.
The downside is I have no idea about how to do anything using webcams.
Is there a plugin or gem for rails that integrates webcams easily?
Some quick browsing brought me to abobes site...but I haven't used it before, and though I dont mind learning new things, I'd like to get this out quickly so I'd rather stick to what I know.
What you do you use for webcams?
You would have to use a third-party plug-in to interface the webcam with the site. Rails takes care of things on the back-end (finding and connecting users) but you would need to use Flash or something similar to connect the web page with the camera.
This question is pretty old, but we've been able to use headshot gem in one of our apps.
https://github.com/diwadm/headshot

Resources