FF/IE11: Could not connect to server at wss://.../websocket


#1

So some of my users suddenly run into random connection problems with browsers like IE11 or Firefox.
They end up at an endless loading spinner, while the JS console throws many errors like these:

Reloading the page or whatever doesn’t change anything, the errors keep popping up.
So for some reason the browser can’t connect to the websocket(s) but I can’t see any problems in my code, this has to be a problem somehow related with Meteor itself I think.

sidenote: some of my users report that they only run into these problems after me upgrading the app to Meteor v1.8 - before it was running on v1.7.x.

Can someone help?

Cheers, Patrick


#2

Are you serving directly out of the meteor run server?


#3

Sorry for my late reply:
No, this was in production!

Multiple docker containers running behind a nginx proxy on an Ubuntu machine. No meteor run, just normal nodejs in docker containers.


#4

Did you configure nginx yourself? Are you trying to say you’re using the Elastic Beanstalk Docker runtime? Are you trying to say you’re using an Elastic Load Balancer to terminate SSL?

apache and nginx are tricky to configure correctly for SSL for all browsers. In particular, you might be rewriting headers in a way that the SSL quirks in Firefox and IE are too strict to allow.

In a Docker Swarm environment, traefik is much easier to configure, especially for SSL, and Just Works for web sockets, unlike nginx and apache. Maybe take a look at that? Use ACME on demand, it Just Works.

I use traefik in production for Meteor with SSL, I just don’t get involved in the web socket configuration headaches.


#5

Hi Patrick,

did you solve it? I just saw your post. I know some of my users have the same problem if I don’t run SSL, as they are behind a proxy. Do you use SSL?

regards,

Paul


#6

Hi guys,

Thanks for your replies!

I am running a standard nginx proxy. I followed this tutorial.

I wasn’t aware of traefik - will have a look.

And yes, I am running ssl - including force-ssl package.

cheers, Patrick


#7

That tutorial is buggy. There’s nothing standard about it!

It should have been a big red flag when he writes “We actually need to update the default nginx.conf template the ships with Mechanic. It’s good, but it doesn’t play very nicely with Meteor’s websockets.”

Don’t use nginx!