Skip to content

Instantly share code, notes, and snippets.

@brianleroux
Forked from ry/https-hello-world.js
Created January 4, 2011 02:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianleroux/764316 to your computer and use it in GitHub Desktop.
Save brianleroux/764316 to your computer and use it in GitHub Desktop.
// curl -k https://localhost:8000/
var https = require('https');
var fs = require('fs');
var options = {
key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
};
var server = https.createServer(options, function (req, res) {
res.writeHead(200);
res.end("hello world\n");
}).listen(8000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment