Skip to content

Instantly share code, notes, and snippets.

Created January 14, 2013 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/165f9538c3eae64f09f2 to your computer and use it in GitHub Desktop.
Save anonymous/165f9538c3eae64f09f2 to your computer and use it in GitHub Desktop.
https server
var fs = require("fs"),
https = require("https");
var handler = function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
};
var options = {
key: fs.readFileSync('privatekey.pem'),
cert: fs.readFileSync('certificate.pem')
};
var server = https.createServer(options, handler);
//server.setSecure(credentials);
server.listen(443);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment