tristandunn / pusher-fake-example Goto Github PK
View Code? Open in Web Editor NEWAn example of pusher-fake with RSpec to test a Rails application.
Home Page: https://github.com/tristandunn/pusher-fake
License: MIT License
An example of pusher-fake with RSpec to test a Rails application.
Home Page: https://github.com/tristandunn/pusher-fake
License: MIT License
The following error repeats for exactly 44 seconds on page load, and then finally the websocket connection will succeed. After that communication works fine. I'm running from the background javascript page of a chrome extension on same localhost. localhost is 64bit Ubuntu 14.04 LTS with Chrome 49
I don't understand why ssl is coming in to play at all? I've tried to set every relevant configuration on pusher fake server and javascript client to be unencrypted.
[16219:16258:0312/154027:ERROR:ssl_client_socket_openssl.cc(1149)] handshake failed; returned -1, SSL error code 1, net
_error -100
[16219:16258:0312/154027:ERROR:ssl_client_socket_openssl.cc(1149)] handshake failed; returned -1, SSL error code 1, net
_error -100
[16219:16219:0312/154027:INFO:CONSOLE(228)] "Pusher : Connecting : {"transport":"ws","url":"ws://localhost:50389/app/?protocol=7&client=js&version=3.0.0&flash=false"}", source: chrome-extension:///background.js (228)
pusher-js-3.0.0.js
var pusher = new Pusher(PUSHER_API_KEY, {
wsHost: 'localhost',
wsPort: 50389,
httpHost: 'localhost',
httpPort: 39381,
encrypted: false,
disableStats: true,
enabledTransports: ["ws"],
authEndpoint: PUSHER_AUTH_URL,
auth: {
headers: {
'Authorization': authToken
}
}
});
Config in pusher.rb
Pusher.app_id = ENV["PUSHER_APP_ID"]
Pusher.key = ENV["PUSHER_API_KEY"]
Pusher.secret = ENV["PUSHER_API_SECRET"]
PUSHER_HTTP_HOST = ENV["PUSHER_HTTP_HOST"] # 39381
HTTP_PORT = ENV["PUSHER_HTTP_PORT"] #localhost
PUSHER_WS_PORT = ENV["PUSHER_WS_PORT"] # 50389
PUSHER_WS_HOST = ENV["PUSHER_WS_HOST"] #localhost
require "pusher-fake"
Thin::Logging.silent = false
PusherFake.configuration.verbose = true
PusherFake.configuration.web_options = { host: PUSHER_HTTP_HOST, port: HTTP_PORT }
PusherFake.configuration.socket_options = { host: PUSHER_WS_HOST, port: PUSHER_WS_PORT, secure: false }
require "pusher-fake/support/base"
---Log---
No logging after boot until the 44 second mark.
=> Booting Thin
=> Rails 4.2.5 application starting in development on http://0.0.0.0:3000
=> Run rails server -h
for more startup options
=> Ctrl-C to shutdown server
PusherFake socket_options
{:host=>"localhost", :port=>"50389", :secure=>false}
PusherFake web_options
{:host=>"localhost", :port=>"39381"}
Thin web server (v1.6.4 codename Gob Bluth)
Maximum connections set to 1024
Listening on 0.0.0.0:3000, CTRL+C to stop
Gemfile in pusher-fake-example:
source "https://rubygems.org"
gem "pusher", "0.17.0"
gem "pusher-fake", "1.5.0"
gem "rails", "4.2.5"
gem "thin", "1.6.4"
gem "eventmachine", "1.0.9.1"
Any ideas?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.