Last active
August 29, 2015 14:16
-
-
Save ysmood/8f330ccffc99f18c1c74 to your computer and use it in GitHub Desktop.
https example
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
### | |
openssl genrsa -out key.pem | |
openssl req -new -key key.pem -out csr.pem | |
openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem | |
rm csr.pem | |
### | |
{ kit } = require 'nobone' | |
https = require 'https' | |
port = 8123 | |
opts = | |
key: kit.readFileSync 'key.pem' | |
cert: kit.readFileSync 'cert.pem' | |
https.createServer opts, (req, res) -> | |
res.end 'ok' | |
.listen port, -> | |
kit.log 'Listen: ' + port | |
kit.request { | |
url: "https://127.0.1:#{port}" | |
rejectUnauthorized: false | |
} | |
.then (body) -> | |
kit.log body |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment