|
@ -484,6 +484,11 @@ function Server (requestListener) { |
|
|
} |
|
|
} |
|
|
sys.inherits(Server, net.Server); |
|
|
sys.inherits(Server, net.Server); |
|
|
|
|
|
|
|
|
|
|
|
Server.prototype.setSecure = function (credentials) { |
|
|
|
|
|
this.secure = true; |
|
|
|
|
|
this.credentials = credentials; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
exports.Server = Server; |
|
|
exports.Server = Server; |
|
|
|
|
|
|
|
|
exports.createServer = function (requestListener) { |
|
|
exports.createServer = function (requestListener) { |
|
@ -498,6 +503,10 @@ function connectionListener (socket) { |
|
|
|
|
|
|
|
|
var parser = newParser('request'); |
|
|
var parser = newParser('request'); |
|
|
|
|
|
|
|
|
|
|
|
if (self.secure) { |
|
|
|
|
|
socket.setSecure(self.credentials); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
socket.ondata = function (d, start, end) { |
|
|
socket.ondata = function (d, start, end) { |
|
|
parser.execute(d, start, end - start); |
|
|
parser.execute(d, start, end - start); |
|
|
}; |
|
|
}; |
|
|