1
所以我在app.js
文件下面的代码:如何使用集群和node.js中同时运行的HTTP和HTTPS服务器
http.createServer(function(request, response) {
// code
}).listen(80);
// var options = ...
https.createServer(options, function (request, response) {
// code
}).listen(443);
如何使用集群在单个进程同时运行服务器对象?
感谢
由于您已经将不得不考虑如何运行您的Web服务器的多个实例(否则你不会使用群集) ,为什么你想在单个工人中运行http和https服务器? –
如果节点上没有性能问题,那么在一个进程中同时使用HTTP和HTTPS时,我的架构将更容易管理。 – Mark