WebSocket is closed before the connection is established.

I was getting this error during my initial "hello, world!" testing. Try setting the cluster explicitly:

const pusher = new Pusher('APPID', { 
  cluster: 'us2', // look up your cluster in your pusher app's dashboard
  encrypted: true 
});

I thought 'us2' was default so I didn't set it at first, but maybe not!

就是没有设置cluster这个值,在创建pusher的时候显式的设置一下就行了

发表回复

您的电子邮箱地址不会被公开。