How to add rooms in Node.js with

I have been following up many articles to learn making chat application with Node.js and Everything is clear and I can make an application moving messages from client to server and emitting to all etc but only one thing is not clearing and cannot figure this out.

How can I add rooms to

What is the code to add rooms to sockets.manager? The most simple and thorough article I found is but after a long struggle I still could not find where the author adds new rooms to server.


returns list of rooms. Your question is not correct. You don't add rooms to instead you make a socket join a room and that room is added to

To make a socket join a room use this:

io.sockets.on('connection', function(socket){
    var room = 'Your room name'; = room;
    socket.on('disconnect', function(){

Need Your Help

Generate HTML file in c# on click button

c# html

How can i create HTML file on submit button click in c#,I don't know any syntax about this ,Please suggest me How to create Html page in C#

Set Script Task code dynamically in SSIS 2012

c# ssis migration sql-server-2012

In my application, a script task is created dynamically.