faye

Node js Faye Client not working properly with HTTPS

可紊 提交于 2019-12-23 02:36:47
问题 I tried to integrate node js with my application, I have just test the http server It works well, but when I use https server as following with my index.php to subscribe the message, This does not work. Start a server var https = require('https'), faye = require('faye'); var fs = require('fs'); var options = { key: fs.readFileSync('/etc/apache2/ssl/apache.key'), cert: fs.readFileSync('/etc/apache2/ssl/apache.crt') }; var server = https.createServer(options), bayeux = new faye.NodeAdapter(

Using rails sync gem with Faye and Thin in production mode on Heroku

。_饼干妹妹 提交于 2019-12-21 05:41:01
问题 I'm trying to set up the 'sync' gem to enable real time updates in my rails app. This uses Faye as a real time push service and thin as the webserver. I"m VERY new to this. So any advice is appreciated. I have this working on my local server, but don't know how to get it working in production mode on heroku. This is my setup: In my gemfile: gem 'faye' gem 'thin', require: false gem 'sync' In my root folder, I have a sync.ru file require "bundler/setup" require "yaml" require "faye" require

faye ruby client is not working

≡放荡痞女 提交于 2019-12-20 10:56:02
问题 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

Faye in jruby on rails

让人想犯罪 __ 提交于 2019-12-13 16:55:33
问题 I have searched A LOT and couldn't find any resource that says I can use Faye with jruby. I have found this one that says that it doen't play well with jruby but it's really really old. Also I have found this that looks like they have implemented a Java native extension in order to support jruby?? Does anyone know if I can use it in a Jruby on rails project? Thanks! 回答1: From the creator of Faye: Yes, the server runs on JRuby. The client uses either WebSocket, EventSource, XMLHttpRequest,

Does Faye work on the iPad

我的梦境 提交于 2019-12-13 05:30:37
问题 I've been playing with Faye and have gotten a test rails application to work on my computer's browser (Chrome 30.0.1599.101), but when I tried to access the same page on my iPad the messaging seemed to be broken. As far as I can tell, it seems that websockets, the technology used by Faye, isn't supported on most mobile browsers. I tried Chrome, Firefox, and Safari on the iPad and couldn't get Faye to work on any of those. Is there a mobile browser that supports Faye or some other messaging

How do I get a Faye client given a client ID?

依然范特西╮ 提交于 2019-12-12 21:57:22
问题 Faye allows you to monitor various events, such as handshake or subscribe . These callback blocks are only supplied the client_id value rather than the client itself. For example: server = Faye::RackAdapter.new(mount: '/faye', timeout: 45) server.bind(:handshake) do |client_id| puts "Received handshake from #{client_id}" end How can I access the client given the client_id ? Or how can I access more information in the handshake, such as cookies provided in the request header (if that info is

Sending large file in websocket before timeout

我怕爱的太早我们不能终老 提交于 2019-12-12 02:27:14
问题 I'm using Faye and EventMachine to open a socket to another server. The server times out if it doesn't detect activity. How do I send the file (binary encoded) so the server doesn't time out? Here's what I have: media_path = "/path/to/media/file" EM.run { ws = Faye::WebSocket::Client.new(uri) ws.on :open do |event| puts "Opening socket" ws.send(File.read(media_path)) end ws.on :message do |event| puts "Recieving message" end ws.on :close do |event| ws = nil EM.stop end } 回答1: You need to send

Implementing chat in Rails

南楼画角 提交于 2019-12-12 01:47:34
问题 I am trying to implement a chat module in my rails application. I looked into this railscast Faye tutorial. More through the tutorial, Ryan mentions about broadcasting the messages but what I want is more like private conversations between the clients instead of broadcasting. Is it possible to do that through faye? or is there a better way of implementing chat in rails? 回答1: There is a gem that handles the autentications for you for faye, so users can only listen on channels you subscribe

Using private_pub with SSL

大憨熊 提交于 2019-12-11 04:06:33
问题 I have setup private pub with SSL according to https://github.com/ryanb/private_pub#serving-faye-over-https-with-thin, also adding in daemonize: true (tested with and without). I can browse to https://mydomain.com:4443/faye.js and that loads. There are no errors on the page. However, nothing is actually working i.e. no real time events trigger. When trying to PrivatePub.publish_to in the console I get: OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate

How to send binary file over Web Sockets with Rails

别说谁变了你拦得住时间么 提交于 2019-12-10 22:58:24
问题 I have a Rails application where users upload Audio files. I want to send them to a third party server, and I need to connect to the external server using Web sockets, so, I need my Rails application to be a websocket client. I'm trying to figure out how to properly set that up. I'm not committed to any gem just yet, but the 'faye-websocket' gem looks promising. I even found a similar answer in "Sending large file in websocket before timeout", however, using that code doesn't work for me.