title: node.js - broadcast message to all the connected
body: <p>So we have the following node.js code -</p>
  
  <pre><code>var http = require('http');
  
  var server = http.createServer(function (request, response) {
    response.writeHead(200, {"Content-Type": "text/plain"});
    response.write("Hello World! \n");
    response.end(");
  }).listen(8125);
  </code></pre>
  
  <p>Let's say I want to broadcast a message to all the connected users,
  <code>write</code> method of <code>response</code> in the <code>createServer</code> function doesn't do that.</p>
  
  <p>So how can I broadcast message to all the connected users/clients?</p>
  
  <p>There is a way doing it with pure Node.js? because I'm just learning it now, and I prefer using pure node.js for now..</p>