2
https modülü localhost'umda çalışmıyor. Bu blog.mgechev.com öğreticiden geçtim. Düğüm v5.10.1. İştehttps ssl/tls, localhost'ta localhost'ta çalışmıyor
kodu:
//index.js
var fs = require('fs'),
https = require('https'),
express = require('express'),
app = express();
https.createServer({
key: fs.readFileSync('key.pem'),
cert: fs.readFileSync('cert.pem')
}, app).listen(55555);
app.get('/', function (req, res) {
res.header('Content-type', 'text/html');
return res.end('<h1>Hello, Secure World!</h1>');
});
index.js:düğüm Çıktı
https deneyin: // localhost: 55555 –
ben bu deneyin ancak otomatik olarak 'yönlendirildi www.localhost.com: 55555' – vineet
Düğüm sunucusu başlatıldıktan sonra terminalde şifre yazıyor musunuz? –