Created
March 26, 2012 16:55
-
-
Save zhaiduo/2206472 to your computer and use it in GitHub Desktop.
nodejs https
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var https = require('https'); | |
var fs = require('fs'); | |
var options = { | |
key: fs.readFileSync('./nodejs.pem'), | |
cert: fs.readFileSync('./nodejs.crt') | |
}; | |
https.createServer(options, function (req, res) { | |
res.writeHead(200); | |
res.end("hello world\n"); | |
}).listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment