Skip to content

Commit 85b630e

Browse files
authored
fix: fix server attachment (socketio#4127)
The check excluded an HTTPS server from being properly attached. Related: socketio#4124
1 parent 40902a1 commit 85b630e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,7 @@ export class Server<
156156
this.adapter(opts.adapter || Adapter);
157157
this.sockets = this.of("/");
158158
this.opts = opts;
159-
if (srv instanceof http.Server || typeof srv === "number") {
160-
this.attach(srv);
161-
}
159+
if (srv || typeof srv == "number") this.attach(srv as http.Server | number);
162160
}
163161

164162
/**

0 commit comments

Comments
 (0)