faye

Replace Faye with rails 4 server side events? Faye VS rails 4 streaming?

狂风中的少年 提交于 2019-12-05 04:53:39
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? 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

Private messages with Faye and Rails

可紊 提交于 2019-12-05 02:06:43
问题 I'm using the faye gem menitioned in the railscast allowing apps to push messages. Problem is it pushes messages to all chat clients that are open. I need them to be private. It's possible to get private messaging with faye but it's url based. For example all messages will be sent to site.com/foo . But, in my model the chat doesn't have a specific url. Because chat is just a collection of messages sent to you by that user. So if you're logged in as adam site.com/messages/eve would allow you

How to start faye server on a rails app deployed using dokku?

半城伤御伤魂 提交于 2019-12-04 19:45:32
I've hosted my rails application on Digitalocean using Dokku. There's this need for my application to run real-time applications through Faye. I've been trying several ways like the shoreman plugin for Dokku and adding faye: bundle exec rackup faye.ru -s thin -E production to "Procfile" file. But no luck till now, need help on how I can get this Faye server running for my app. You need to make several steps to have working faye server (e.g. on port 9292): Your Procfile is OK Expose port 9292 on Docker. I recommend install docker-options plugin and next dokku docker-options:add timer "-p 9292

PrivatePub is not defined error Rails 3.2 private pub

匆匆过客 提交于 2019-12-04 07:30:52
I want to use private pub gem in my rails application. I implement with railscast 316 After rails g private_pub:install my private_pub.yml file: development: server: "http://0.0.0.0:9292/faye" secret_token: "secret" test: server: "http://0.0.0.0:9292/faye" secret_token: "secret" production: server: "http://0.0.0.0/faye" secret_token: "98ec77eb7077c9899dc53f003abc4d6a0170512a57feab126ed5a32b114e3613" signature_expiration: 3600 # one hour my private_pub.ru file # Run with: rackup private_pub.ru -s thin -E production require "bundler/setup" require "yaml" require "faye" require "private_pub" Faye

Private messages with Faye and Rails

99封情书 提交于 2019-12-03 19:22:31
I'm using the faye gem menitioned in the railscast allowing apps to push messages. Problem is it pushes messages to all chat clients that are open. I need them to be private. It's possible to get private messaging with faye but it's url based. For example all messages will be sent to site.com/foo . But, in my model the chat doesn't have a specific url. Because chat is just a collection of messages sent to you by that user. So if you're logged in as adam site.com/messages/eve would allow you to talk to eve but for eve it's the reverse. site.com/messages/adam . So URL specific private chat is

Websocket header missing

僤鯓⒐⒋嵵緔 提交于 2019-12-03 08:50:40
问题 I'm using the 'faye' gem with Rails 3.2.13. In development I'm running faye on localhost:9292 and my app on localhost:3000. I'm able to activate pop-up windows with a curl request from the command line but I can't establish a connection from within my app. The error I'm getting in my console is: WebSocket connection to 'ws://localhost:9292/faye' failed: Error during WebSocket handshake: 'Upgrade' header is missing I am trying to define a header for faye in my application.js file: $(function()

Rails pub/sub with faye

*爱你&永不变心* 提交于 2019-12-03 06:20:55
问题 In a Rails app I've used Faye (Rack adapter) for push notifications (for chat). I want to use Faye for another use case (more push notifications) but I can't seem to figure it out. In my app a model can be created from a background job so I want to refresh one of my views (say the index action) when the model gets created. Like so: app/models/post.rb class Post include Mongoid::Document after_create :notify_subscribers private def notify_subscribers Faye::Client.publish("/posts") end end app

Confusion over choosing Faye or Rails 4 Actioncontroller::Live

Deadly 提交于 2019-12-03 05:51:12
问题 I have already used Faye with Ruby On Rails, it's almost at 0 cost for me, because I'm running Faye over another server connected to my Rails App. However I have faced some problems like when a query takes too long on the Rails server, after a while the Faye Connection would fail and raise an exception. Now what I'm looking into the Actioncontroller::Live , most of the implementations are using Redis, which will be a bit costy for my startup, however I realized I can't do subscribe/publish

faye ruby client is not working

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using faye on my Rails 2.1 app. And after testing and fixing many things faye ruby client is not working. This is my server code. require 'faye' server = Faye::RackAdapter.new(:mount => '/faye', :timeout => 45) EM.run { thin = Rack::Handler.get('thin') thin.run(server, :Port => 9292) server.bind(:subscribe) do |client_id, channel| puts "[ SUBSCRIBE] #{client_id} -> #{channel}" end server.bind(:unsubscribe) do |client_id, channel| puts "[UNSUBSCRIBE] #{client_id} -> #{channel}" end server.bind(:disconnect) do |client_id| puts "[

Websocket header missing

匿名 (未验证) 提交于 2019-12-03 02:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using the 'faye' gem with Rails 3.2.13. In development I'm running faye on localhost:9292 and my app on localhost:3000. I'm able to activate pop-up windows with a curl request from the command line but I can't establish a connection from within my app. The error I'm getting in my console is: WebSocket connection to 'ws://localhost:9292/faye' failed: Error during WebSocket handshake: 'Upgrade' header is missing I am trying to define a header for faye in my application.js file: $(function() { var faye = new Faye.Client("http://localhost