socketcluster

How to set up socketcluster with SSL


I want to use socketcluster on a dedicated machine with SSL. No proxies or anything like that.

The docs are rather vague on this one. Is it even possible? How do I pass the key and crt file?


Solution

  • Nevermind, have it figured out. Posting solution in case someone else needs a quick hint:

    in scserver.js where it says options = { ... } add this:

      protocol: 'https',
      protocolOptions: {
        key: fs.readFileSync('/path/to/key'),
        cert: fs.readFileSync('/path/to/crt'),
        ca: fs.readFileSync('/path/to/ca/bundle')
      }