简体   繁体   中英

Error when setting the Pusher cluster to 'eu'

I'm using the Pusher Javascript library to create a realtime webapp. Everything works like a charm, however when I set the cluster parameter to eu (my users will be connecting from France only), I get an error.

This is the code I use:

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

And this is the error I get:

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

Am I allowed to use this parameter? Or is there a thing to do in my Pusher dashboard? The Pusher docs are not quite clear about this.

Quoting @dan_waterworth's comment :

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.

The accepted answer doesn't help much IMHO.

In my case, I got confused between PUSHER_KEY and PUSHER_APP_ID .

Hence my code is (in .erb ):

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM