node.js - Getting Node, Running on OS X, to Respond to HTTPS Connections -
i have small node program.
console.log("program started"); var http = require('http'); //configure our http server respond hello world requests. var server = http.createserver(function (request, response) { console.log("processing request url" + request.url); response.writehead(200, {"content-type": "text/html"}); response.end("hello world \n"); }); // listen on port 8000, ip defaults 127.0.0.1 server.listen(8000); console.log("program ended"); if run program on macbook , access following url, see hello world message.
http://localhost:8000/ however, i'd have url responding https connections well.
https://localhost:8000/ how can nodejs?
can native http library me? or need express?
yes can via https module :
1 have create certificats , can follow auto here macos
Comments
Post a Comment