不能通过推杆和导轨在websocket上发送消息

时间:2014-11-04 21:40:03

标签: ruby-on-rails pusher

我尝试将一些测试数据发送到我的WebsocketServer,但我无法使其工作:(

我的FireBug控制台说:

Pusher : State changed : initialized -> connecting
Pusher : Connecting : ws://192.168.56.101:8080/app/123?protocol=5&client=js&version=1.12.5&flash=false
Pusher : State changed : connecting -> connected
Pusher : Event sent : {"event":"pusher:subscribe","data":{"channel":"test"}}
Pusher : Event recd : {"event":"pusher_internal:subscription_succeeded","data":{},"channel":"test"}
Pusher : No callbacks on test for pusher:subscription_succeeded

我的控制器看起来像这样:

Pusher.trigger('test', 'my_event', {:message => 'hello world'})

my developement.rb是这样的:

  # Pusher settings
  require 'pusher'
  Pusher.app_id = '123'
  Pusher.key = '123'
  Pusher.secret = '123'
  Pusher.host = 'localhost'
  Pusher.logger = Rails.logger

my developement.log有这样的信息: 使用Pusher.localhost我收到此错误:

Pusher::Error (404 Not found (/apps/123/events)):
  app/controllers/admin/broadcasts_controller.rb:17:in `create'

没有Pusher.host我得到了这个:

   Pusher::AuthenticationError (Unknown auth_key):
      app/controllers/home_controller.rb:3:in `index'

0 个答案:

没有答案