Configure TimeOut and Transports in Socket.IO 1.0

后端 未结 1 1607
遇见更好的自我
遇见更好的自我 2021-01-06 17:52

In old versions of Socket.IO (< 0.9), I configured \"close timeout\" and \"transports\" this way:

io.set(\"transports\", [\"xhr-polling\"]);
io.set(\"clos         


        
相关标签:
1条回答
  • 2021-01-06 18:32

    See the documentation here: http://socket.io/docs/migrating-from-0-9/#configuration-differences

    Basically, you just have to set those when you initialize the server:

    var socket = require('socket.io')({
      // options go here
    });
    
    0 讨论(0)
提交回复
热议问题