S
S
Space2014-03-12 15:38:33
JavaScript
Space, 2014-03-12 15:38:33

How to display all clients in nodeJs?

Hello. I don't know where to look for answers to this question.

io.sockets.on( 'connection', function( client ) {
  client.broadcast.emit('clientNew', {clientNew : 'Пришел новый Вася!'});

This is part of the code on the server. In general, how can I display all users in one variable, and then I will send them to the client and divide them line by line. Or which is better? Is there, maybe, who has articles on such lamer questions on the node?
Waiting for answers, thanks.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Starkov, 2014-03-12
@ruslite

varclients = io.sockets.clients();
details here
stackoverflow.com/questions/6563885/socket-io-how-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question