Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up secure websocket on Meteor app (localhost)

Tags:

meteor

wss

ddp

I used Asteroid as my ddp to connect with my Meteor app as backend. The front end run https and it works perfectly on Chrome. So it actually a consist of two separate apps run independently. But it didn't go well in Safari. Safari block the connection as there are mix/insecure content.

So far I have force-ssl package added to my Meteor app but still no luck. How do I enable wss protocol on my local development machine (localhost)

like image 227
Muhaimin Avatar asked Jul 18 '17 09:07

Muhaimin


1 Answers

Have you tried to connect on localhost by just using http://localhost:3000? If your Meteor backend and frontend are both running on localhost then you shouldn't be trying to connect via https or wss. Your machine doesn't have a trusted certificate running on it so the connection can't be made.

Also, don't use force-ssl locally for the same reason I mention above.

Please post the full error from Safari if the above solution doesn't work. Please clarify what is running where (are they both on localhost, or just one).

like image 102
JoshJoe Avatar answered Dec 23 '22 06:12

JoshJoe