Answer the question
In order to leave comments, you need to log in
How to properly install SSL certificate with Node.js script (Socket.io) without express?
Installed free SSL from reg.ru on a node.js script as follows (back):
var https = require('https')
var options = {
key: fs.readFileSync('1.pem').toString(),
cert: fs.readFileSync('2.pem').toString(),
ca : fs.readFileSync('4.csr').toString()
}
var app = https.createServer(options)
var io = require('socket.io').listen(app)
app.listen(config.port || 8083)
var socketIO = io('https://domain.com:8080' || 'https://domain.com:8083', {secure: true})
socketIO.once('connect', function(){
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question