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

1

6

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)

Foliose answered 18/7, 2017 at 9:52 Comment(0)
C
1

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).

Causeuse answered 28/7, 2017 at 16:45 Comment(4)
Yes both are running localhost. I can generate self sign cert as well and I really need the secure layer because browser cannot accept mixed contentFoliose
Even a self signed cert won't work here since it won't be trusted. You don't need force-ssl, instead use something like nginx or apache to force ssl when you are hosting your app. Then in your dev environment remove the force-ssl package and it should work for you.Causeuse
@Causeuse I am facing the similar issue and I have posted it on stackoverflow, not getting any responses. Can you please have a look at it ? #47430622Glyoxaline
@Glyoxaline I replied thereCauseuse

© 2022 - 2024 — McMap. All rights reserved.