-
-
Save anonymous/165f9538c3eae64f09f2 to your computer and use it in GitHub Desktop.
https server
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 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