1
我想在NodeJS-app中同時提供HTTP和HTTPS。它適用於內部應用程序,其中一些訪問者不支持HTTPS。在NodeJS中偵聽HTTP和HTTPS的正確方法
這是簡單的正確方法,還是應該是2個獨立的NodeJS應用程序?
http.createServer(app).listen(80, function() {
console.log('My insecure site');
});
https.createServer(options, app).listen(443, function() {
console.log('My sdecure site');
});
這是正確的方法。 – TGrif