【问题标题】:Error when setting the Pusher cluster to 'eu'将 Pusher 集群设置为“eu”时出错
【发布时间】:2015-05-01 09:00:46
【问题描述】:

我正在使用Pusher Javascript library 创建一个实时网络应用程序。一切都像一个魅力,但是当我将cluster 参数设置为eu(我的用户将仅从法国连接)时,我收到了一个错误。

这是我使用的代码:

var pusher = new Pusher('<thisismykey>', {
  encrypted: true,
  authEndpoint: '{{ baseUrl() }}/pusher_auth',
  cluster: 'eu' // This
});

这是我得到的错误:

{
  "type": "WebSocketError",
  "error": {
    "type": "PusherError",
    "data": {
      "code": 4001,
      "message": "Could not find app by key <thisismykey>. Perhaps you're connecting to the wrong cluster."
    }
  }
}

我可以使用这个参数吗?或者在我的 Pusher 仪表板中有什么事情要做吗? Pusher 文档对此并不十分清楚。

【问题讨论】:

  • 一个 Pusher 应用存在于特定集群中。如果您与支持人员取得联系,他们将能够为您提供欧盟集群中的应用程序。
  • 更清楚了,谢谢!文档中是否提到了这一点?另外,发布一个anwser,以便我接受它:)

标签: javascript websocket pusher


【解决方案1】:

接受的答案对恕我直言没有多大帮助。

就我而言,我对PUSHER_KEYPUSHER_APP_ID 感到困惑。

因此我的代码是(.erb):

  pusher = new Pusher('<%=ENV['PUSHER_KEY']%>',
    cluster: 'eu',
    encrypted: true,
    authEndpoint: '/notifications/auth'
  )

【讨论】:

    【解决方案2】:

    引用@dan_waterworth's comment:

    Pusher 应用存在于特定集群中。如果您与支持人员取得联系,他们将能够为您提供欧盟集群中的应用程序。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-08
      • 2011-07-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多