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); } /**