首页新闻找找看学习计划

node服务器开启两个https端口,过一段时间卡死

0
[待解决问题]

我用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);})

bm123的主页 bm123 | 菜鸟二级 | 园豆:204
提问于:2020-02-10 21:30
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册