0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
nodejs/lib/https.js
2011-01-03 15:51:05 -08:00

23 lines
515 B
JavaScript

var tls = require('tls');
var http = require('http');
var inherits = require('util').inherits;
function Server(opts, requestListener) {
if (!(this instanceof Server)) return new Server(opts, requestListener);
tls.Server.call(this, opts, http._connectionListener);
if (requestListener) {
this.addListener('request', requestListener);
}
}
inherits(Server, tls.Server);
exports.Server = Server;
exports.createServer = function(opts, requestListener) {
return new Server(opts, requestListener);
};