2
votes

I have been at this for days and I can't seem to find the solution for this. I have a live website, and I recently installed the ssl certificate and made the website available on https.

What's really strange is that at first the website worked well on https. For about a day or so it was live and working well. But then the next day I checked and the site is now giving me this error:

WebSocket connection to 'wss://domain.com/sockjs/421/dto72qfy/websocket' failed: WebSocket is closed before the connection is established.

The navigation bar loads and the sidebar loads, but the content doesn't, it's just stuck in the 'loading' template. If I check the domain in http the website is working fine.

I am using meteor up (mup) to upload the site and digital ocean. One of the few things I have changed was the mup.json

...
  // Configure environment
  "env": {
    "ROOT_URL": "https://website.com/"
    //"PORT": 80
  },
  "ssl": {
    "pem": "./ssl.pem"
    //"backendPort": 80
  },
...

I'm not sure how to deal with websockets and why they only have problems in https. If anyone has gotten their meteor app to work with mup and ssh I would really appreciate some help.

1

1 Answers

1
votes

You can disable websockets by adding the following environmental variable in your mup.json

"DISABLE_WEBSOCKETS"=1

If you don't want to disable websockets, you can try option 2 from here.

We have websockets disabled on https://saturnapi.com; you can see yourself if it is usable. Others have also reported that disabling websockets still allow for a usable app, albeit a bit slower. It should depend on how your app is configured, so I recommend giving it a try and reverting to the other solutions if it doesn't work.