将 Pusher 集群设置为 'eu' 时出错
Error when setting the Pusher cluster to 'eu'
我将 Pusher Javascript library to create a realtime webapp. Everything works like a charm, however when I set the 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 文档对此不是很清楚。
引用 :
A Pusher app exists in a particular cluster. If you get in touch with support, they'll be able to get you an app in the EU cluster.
恕我直言,接受的答案没有多大帮助。
就我而言,我在 PUSHER_KEY
和 PUSHER_APP_ID
之间感到困惑。
因此我的代码是(在 .erb
中):
pusher = new Pusher('<%=ENV['PUSHER_KEY']%>',
cluster: 'eu',
encrypted: true,
authEndpoint: '/notifications/auth'
)
我将 Pusher Javascript library to create a realtime webapp. Everything works like a charm, however when I set the 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 文档对此不是很清楚。
引用
A Pusher app exists in a particular cluster. If you get in touch with support, they'll be able to get you an app in the EU cluster.
恕我直言,接受的答案没有多大帮助。
就我而言,我在 PUSHER_KEY
和 PUSHER_APP_ID
之间感到困惑。
因此我的代码是(在 .erb
中):
pusher = new Pusher('<%=ENV['PUSHER_KEY']%>',
cluster: 'eu',
encrypted: true,
authEndpoint: '/notifications/auth'
)