title: create chat application in node js for send message to particular client
body: <p>hi friends i have one question about chat application with node js and socket io </p>
  
  <p>i have one website and its application in application user send message to web and web will answered that user so how can i create this type of application </p>
  
  <p>my idea is like in web web user send message to client no 10 to node server and node server will send only that user which client no is 10 </p>
  
  <p>this is my node js and socket io code for basic chat </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var port = "3000"
  var express = require('express');  
  var app = express();  
  var server = require('http').createServer(app);  
  var io = require('socket.io')(server);
  var ioClientList = [];
  app.use(express.static(__dirname + '/bower_components'));  
  app.get('/', function(req, res,next) {  
      // res.sendFile(__dirname + '/index.html');
      res.send('&lt;h1&gt;Hello world&lt;/h1&gt;');
    });
  
  server.listen(port, function(){
   console.log('listen on port'+ port);
  }); 
  
  io.sockets.on('connection', function(socket) {
      console.log('dddd');
  
      socket.on('message', function(message) {
          socket.broadcast.emit('message', message);
      });
  
     socket.on('chat', function(message) {
          socket.broadcast.emit('chat', message);
      });
  
    
  
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>so how can i store connected client with send its ID and send message using that ID</p>
  
  <p>please help me for this question  </p>