meteorBuzz
meteorBuzz

Reputation: 3200

Meteor: Error during WebSocket handshake: Unexpected response code: 400

What could be the possible cause of the error Error during WebSocket handshake: Unexpected response code: 400?

The app is hosted on ubuntu and deployed using the npm mup package. I included my bundled ssl pem file within mup.json.

Is there anything else that I need to configure on the server?

Upvotes: 2

Views: 2615

Answers (2)

icc97
icc97

Reputation: 12863

I had this error when I was connecting via a hotel WiFi. The problem was that you are always connecting to the internet via their proxy.

My solution to this was to use my mobile phone as a Wifi hotspot. I have Android 6.0.1, and you can access the menu through:

Settings > More > Tethering & portable hotspot > Set up Wi-Fi hotspot (and then enable 'Portable Wi-Fi hotspot')

Upvotes: 0

Tarang
Tarang

Reputation: 75975

This can be caused by one of the three reasons:

  1. Some ISPs may use proxies which don't support websockets. This is more apparent over 3G networks

  2. If your app has crashed. Meteor tries to connect to the server and can't since it's not online.

  3. This can also happen if Nginx isn't configured to use WebSockets, and your MUP instance is sitting behind a WebSocket.

So if your app is working as expected (maybe just takes a bit too long to get connected) & has this error in development console it's likely due to a proxy server. To avoid this try getting SSL (https://) installed on your server too. This way the ISP or proxy is not able to alter your app's connection.

Upvotes: 2

Related Questions