4 * Copyright(c) 2010 Sencha Inc.
5 * Copyright(c) 2011 TJ Holowaychuk
10 * Module dependencies.
13 var HTTPServer = require('./http').Server
14 , https = require('https');
17 * Initialize a new `Server` with the given
18 *`options` and `middleware`. The HTTPS api
19 * is identical to the [HTTP](http.html) server,
20 * however TLS `options` must be provided before
21 * passing in the optional middleware.
23 * @params {Object} options
24 * @params {Array} middleawre
29 var Server = exports.Server = function HTTPSServer(options, middleware) {
31 middleware.forEach(function(fn){
34 https.Server.call(this, options, this.handle);
38 * Inherit from `http.Server.prototype`.
41 Server.prototype.__proto__ = https.Server.prototype;
43 // mixin HTTPServer methods
45 Object.keys(HTTPServer.prototype).forEach(function(method){
46 Server.prototype[method] = HTTPServer.prototype[method];