Describe the bug
4.2 -> 4.3 added this if statement check:
|
if (srv instanceof http.Server || typeof srv === "number") { |
That check means that servers made with the https module won't be bound:
To Reproduce
Socket.IO server version: 4.3.0
Server
const { readFileSync } = require("fs");
const { createServer } = require("https");
const { Server } = require("socket.io");
const httpServer = createServer({
key: readFileSync("/path/to/my/key.pem"),
cert: readFileSync("/path/to/my/cert.pem")
});
const io = new Server(httpServer, { /* options */ });
io.on("connection", (socket) => {
// ...
});
httpServer.listen(3000);
^ From https://socket.io/docs/v4/server-initialization/#with-an-https-server
Expected behavior
The https server should be attached. It isn't. You can see this by modifying the following in the /dist/index.js
console.log('look for this 1');
if (srv instanceof http.Server || typeof srv === "number") {
console.log('look for this 2');
this.attach(srv);
}
Describe the bug
4.2 -> 4.3 added this if statement check:
socket.io/lib/index.ts
Line 159 in 95810aa
That check means that servers made with the https module won't be bound:
To Reproduce
Socket.IO server version:
4.3.0Server
^ From https://socket.io/docs/v4/server-initialization/#with-an-https-server
Expected behavior
The https server should be attached. It isn't. You can see this by modifying the following in the
/dist/index.js