From 45b8d24ea60b42f3c20932a96b57f148d7bf58f4 Mon Sep 17 00:00:00 2001 From: Rhys Jones Date: Mon, 12 Apr 2010 20:36:46 +0100 Subject: [PATCH] Added https server support --- lib/http.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/http.js b/lib/http.js index 8e85fd51b4..de73fdbad2 100644 --- a/lib/http.js +++ b/lib/http.js @@ -484,6 +484,11 @@ function Server (requestListener) { } sys.inherits(Server, net.Server); +Server.prototype.setSecure = function (credentials) { + this.secure = true; + this.credentials = credentials; +} + exports.Server = Server; exports.createServer = function (requestListener) { @@ -498,6 +503,10 @@ function connectionListener (socket) { var parser = newParser('request'); + if (self.secure) { + socket.setSecure(self.credentials); + } + socket.ondata = function (d, start, end) { parser.execute(d, start, end - start); };