Use SSL https server error
Opened this issue · 0 comments
blackcatxt commented
var options = {
key: fs.readFileSync('./ssl/xxxx.key', 'utf8'),
cert: fs.readFileSync('./ssl/xxxx.cert', 'utf8')
};
// Start the server
var hserver = https.createServer(options, function(req, res){
res.setHeader('Access-Control-Allow-Origin', '*');
var done = finalhandler(req, res)
// res.end({title:12})
serve(req, res, done)
});
hserver.listen(this.config.serverPort,"0.0.0.0",this.onHttpServerOpen.bind(this));
this.socketServer = new WebSocket.Server({server: hserver, perMessageDeflate: false, maxPayload: 4096});