How to set up socketcluster with SSL

169 Views Asked by At

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?

1

There are 1 best solutions below

0
Nick M On BEST ANSWER

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')
  }