faye

Faye setup in production

好久不见. 提交于 2019-12-10 10:24:38
问题 I've set up Faye on localhost, and works fine. I'm now trying to deploy it on DigitalOcean VPS, with Cloud66 deployment service. To run the command I use an "after_rails" hook. rackup $RAILS_STACK_PATH/faye.ru -s thin -E production This gives me the error: Error during deployment: Error during after_rails hook: Server: not_specified. Failed to run command: /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- faye (LoadError) from /usr/local

faye is not available on client browser for node js

北城余情 提交于 2019-12-08 11:31:37
问题 I have created a sample application which is a chat server using nodejs + faye + epxress which is running fine on my local machine and I able to send message to server and publish it to client browser. But when I deployed my app on Openshift it is not working. I am able to send message but I am not able to publish message. Here is my code snippet Server.js var path = require('path');var http = require('http'), express = require('express'), faye = require('faye'); var bodyParser = require(

secure Websocket client in ruby

房东的猫 提交于 2019-12-08 11:12:42
问题 How can I make a secure (TLS) websocket client connection using Faye-websocket in Ruby? I am using faye/websocket gem in my script. require 'faye/websocket' require 'eventmachine' EM.run { ws = Faye::WebSocket::Client.new('wss://aws.com/gateway',:ssl => { :private_key_file => 'path/to/ssl.key', :cert_chain_file => 'path/to/ssl.crt' }, :headers => { 'Authorization' => 'Basic bXl1c2VyOm15cGFzc3dvcmQ='}) ws.on :open do |event| p [:open] ws.send('Hello, world!') end ws.on :message do |event| p [

Node js Faye Client not working properly with HTTPS

£可爱£侵袭症+ 提交于 2019-12-08 08:00:29
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({mount: '/'}); bayeux.attach(server); server.listen(1337); Create a client <script src="faye-browser-min.js

How do I create Private channel between two user

人走茶凉 提交于 2019-12-08 02:27:11
问题 I have been implementing Faye server for chat application. Currently we have 400000 users in our table. Each user can chat with one another privately. But I don’t know how to implement private channel between two users using Faye or private pub for 4 lakhs user. Do I have to make a table which will contain around 4 lakhs X 4 lakhs private channel entry, I think that is not a good idea. please guide me. 回答1: The Faye documentation provides some very good information on this subject: http:/

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

守給你的承諾、 提交于 2019-12-07 01:09:05
问题 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? 回答1: To run Rails 4 streaming you need at least Chrome 9+,

Python 字典

前提是你 提交于 2019-12-06 16:22:53
Python 字典 字典 数据类型的分类 可变(不可哈希)的:list dict set 不可变(可哈希)的:str bool int tuple 字典: {}括起来,以键值对形式存储的容器型数据类型: 键必须唯一,且是不可变的数据类型:str bool int tuple 值可以是任意数据类型,对象 查询速度非常快,以空间换时间。 1.字典的创建方式 #方法一: d1 = dict((('地址','上海'),("年龄",20),(1,2019))) #看清楚这里有几层括号 print(d1) {'地址': '上海', '年龄': 20, 1: 2019} #方法二: d2 = dict(地址 = "上海",年龄 = 20) #注意:键不加双引号 print(d2) {'地址': '上海', '年龄': 20} d3 = dict({'地址':"上海","年龄":20,1:2019}) print(d3) d4 = {'地址':"上海","年龄":20,1:2019} print(d4) {'地址': '上海', '年龄': 20, 1: 2019} {'地址': '上海', '年龄': 20, 1: 2019} 2.增 直接增加 --有则改之,无则增加 setdefault --有则不变,无则增加 #直接增加 d = dict(name = "Faye",age = 20,

How do I create Private channel between two user

只愿长相守 提交于 2019-12-06 12:48:33
I have been implementing Faye server for chat application. Currently we have 400000 users in our table. Each user can chat with one another privately. But I don’t know how to implement private channel between two users using Faye or private pub for 4 lakhs user. Do I have to make a table which will contain around 4 lakhs X 4 lakhs private channel entry, I think that is not a good idea. please guide me. The Faye documentation provides some very good information on this subject: http://faye.jcoglan.com/security.html In your case the How should I authenticate clients? is particularly relevant.

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

↘锁芯ラ 提交于 2019-12-06 12:47:54
问题 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. 回答1: You need to make several steps to have working faye server (e.g. on port 9292): Your Procfile is OK Expose port

PrivatePub is not defined error Rails 3.2 private pub

那年仲夏 提交于 2019-12-06 03:57:46
问题 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