From 0ef2a4d02c9350aff163df9cb61aece89c4dac0f Mon Sep 17 00:00:00 2001 From: Josh Field Date: Sun, 17 Oct 2021 08:58:55 +1100 Subject: [PATCH] fix: fix server attachment (#4127) The check excluded an HTTPS server from being properly attached. Related: https://github.com/socketio/socket.io/issues/4124 --- lib/index.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/index.ts b/lib/index.ts index 5f9427c3c2..72c87ef677 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -156,9 +156,7 @@ export class Server< this.adapter(opts.adapter || Adapter); this.sockets = this.of("/"); this.opts = opts; - if (srv instanceof http.Server || typeof srv === "number") { - this.attach(srv); - } + if (srv || typeof srv == "number") this.attach(srv as http.Server | number); } /**