webSocketServer node.js how to differentiate clients

后端 未结 10 2031
[愿得一人]
[愿得一人] 2020-12-22 19:36

I am trying to use sockets with node.js, I succeded but I don\'t know how to differentiate clients in my code. The part concerning sockets is this:

var WebSo         


        
10条回答
  •  萌比男神i
    2020-12-22 20:36

    One possible solution here could be appending the deviceId in front of the user id, so we get to separate multiple users with same user id but on different devices.

    ws://xxxxxxx:9000/userID/<>

提交回复
热议问题