socket.io:更新到最新版本,错误:server.handleUpgrade() 被同一个套接字多次调用

时间:2021-01-02 12:09:00

标签: socket.io

我的旧socket.io

var ssl = {
    key: fs.readFileSync(config.key),
    cert: fs.readFileSync(config.cert),
};
var httpsServer = https.createServer(ssl).listen(2052);
var io = require('socket.io').listen(httpsServer, {log: true, pingTimeout: 20000});

我更新了 socket.io,但无法再连接了:

var ssl = {
        key: fs.readFileSync(config.key),
        cert: fs.readFileSync(config.cert),
    };
    var httpsServer = https.createServer(ssl).listen(2052);
    var io = require('socket.io')(httpsServer);
    io.listen(httpsServer, {log: true, pingTimeout: 20000});

我有错误:

Error: server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration

0 个答案:

没有答案