Created
December 8, 2010 21:48
-
-
Save ry/733976 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// new node.js tls api | |
var tls = require('tls'); | |
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 = tls.createServer(options, function (s) { | |
s.write("welcome!\n"); | |
s.pipe(s); | |
}).listen(8000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you help me, how can I start encrypted communication at the middle of TCP connection consider new api?