Created
July 16, 2012 19:00
-
-
Save fjakobs/3124364 to your computer and use it in GitHub Desktop.
SSL termination proxy
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
var tls = require("tls"); | |
var net = require("net"); | |
var fs = require("fs"); | |
var host = "c9.dev"; | |
tls.createServer({ | |
key: fs.readFileSync(__dirname + "/key.pem"), | |
cert: fs.readFileSync(__dirname + "/cert.pem") | |
}, function(client) { | |
var socket = new net.Socket(); | |
socket.connect(80, host); | |
client.pipe(socket, { end: false }); | |
socket.pipe(client); | |
}).listen(443, host); | |
console.log("Listening at", host, 443); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
right, but what to do with them? Log and ignore so that the app will at least not terminate?