Establish a DDP connection over SSL in the Meteor app

When a Meteor client uses DDP.connect()

DDP to connect to a server, it is sent in clear text. How can we establish SSL encrypted DDP connections?

+3


source to share


1 answer


Meteor relays on SockJs, according to the SocksJs README :From SockJS' point of view there is nothing special about SSL/HTTPS. Connecting between unencrypted and encrypted sites should work just fine.

My code:



var connection = DDP.connect("ws://127.0.0.1:3000");

      

If you switch from ws

to wss

(WebSocket Secure) if the host supports ssl it will be used. On my localhost, I don't install ssl or drop the "ws", you have to manually code it if you want.

0


source







All Articles