我用node开启了两个服务,在同一个服务器上,但是开启一段时间后就会出现内用大量内存卡死,然后我重启服务器还是不行,必须要关闭一个https服务才能正常,,,这是什么情况,具体 代码如下
开启一 var httpServer = http.createServer(app); var httpsServer = https.createServer({ key:fs.readFileSync(path.join(__dirname, './123.key'), 'utf8'), cert:fs.readFileSync(path.join(__dirname, './123.crt'), 'utf8') }, app);var PORT = 80; var SSLPORT = 443;httpServer.listen(PORT, function() { console.log('HTTP Server is running on: http://localhost:%s', PORT); }); httpsServer.listen(SSLPORT, function() { console.log('HTTPS Server is running on: https://localhost:%s', SSLPORT); });
开启二
var privateKey = fs.readFileSync(path.join(__dirname, './key/123.key'), 'utf8'); var certificate = fs.readFileSync(path.join(__dirname, './key/123.crt'), 'utf8'); var credentials = {key: privateKey, cert: certificate};var httpsServer = https.createServer(credentials, app);httpsServer.listen(8000, function() { console.log('HTTPS Server is running on: https://localhost:%s', 8000);})
相似问题