Socket.io Connected User Count

后端 未结 12 971
有刺的猬
有刺的猬 2021-01-30 20:24

I finally got socket.io to work properly, but I have encountered a strange problem.

I am not sure if this is the best way, but I am using:

io.sockets.cli         


        
12条回答
  •  灰色年华
    2021-01-30 21:05

    Just in case someone gets to this page while using socket.io version 1.0

    You can get the connected clients count from

    socketIO.engine.clientsCount
    

    Need an answer and the above did not work for new version of socket.io

提交回复
热议问题