Skip to content

Commit

Permalink
[feat] Update attach to allow https servers
Browse files Browse the repository at this point in the history
  • Loading branch information
cloverhap committed Apr 27, 2018
1 parent d93ef6a commit a73fa88
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/engine.io.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/

var http = require('http');
var https = require('https');

/**
* Invoking the library as a function delegates to attach if the first argument
Expand All @@ -20,7 +21,8 @@ var http = require('http');
exports = module.exports = function () {
// backwards compatible use as `.attach`
// if first argument is an http server
if (arguments.length && arguments[0] instanceof http.Server) {
if (arguments.length &&
(arguments[0] instanceof http.Server || arguments[0] instanceof https.Server)) {
return attach.apply(this, arguments);
}

Expand Down

0 comments on commit a73fa88

Please sign in to comment.