Simple question, I'm new to using node.js and was curious as to how 开发者_JAVA百科I should uniquely identify a computer?
As with most operations you have no way to identify uniquely a computer. All data is sent stateless and wihout any information of the computer.
But you can change your (x)html application to store unique cookies so the client side part can authenticate to the server with the cookie, perfectly identifying two open tabs of one user.
If you're working with web sockets you can assign each client an id using a random uuid, here's one that'll work on both client and server:
http://www.broofa.com/Tools/Math.uuid.js
and speed benchmarks for each flavor:
http://jsperf.com/uuid-from-broofa-com
精彩评论