Skip to content

Instantly share code, notes, and snippets.

@heapwolf
Created August 7, 2012 06:40
Show Gist options
  • Save heapwolf/3282422 to your computer and use it in GitHub Desktop.
Save heapwolf/3282422 to your computer and use it in GitHub Desktop.
tls/server
var tls = require('tls'),
fs = require('fs');
var options = {
key: fs.readFileSync('private-key.pem'),
cert: fs.readFileSync('public-cert.pem')
};
tls.createServer(options, function (s) {
s.write("Hello, World\n");
s.pipe(s);
}).listen(8000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment