node.js - Cannot open site with https server using Express -
var fs = require('fs'), https = require('https'), express = require('express'), app = express(); https.createserver({ key: fs.readfilesync('./ssl/key.pem'), cert: fs.readfilesync('./ssl/cert.pem') }, app).listen(55555); app.get('/', function (req, res) { res.header('content-type', 'text/html'); return res.end('<h1>hello, secure world!</h1>'); });
i tried many times using https server based on express, while still cannot open site, example using chrome:
it says "no data received" , "err_empty_response".
so listening, response cannot sent client, why? thank you!
Comments
Post a Comment