title: Client not updating realtime with Socket.io and Node.js
body: <p>Why isn't my client side updating automatically using socket.io and node.js?</p>
  
  <p>My backend accepts JSON POST requests from PHP, then it emits the data to all connected devices.</p>
  
  <p>My backend code</p>
  
  <pre><code>app.post('/', function (req, res) {
      console.log(req.body);
      subdata = req.body;
      res.send('ok');
  });
  
  io.sockets.on('connection', function (socket) {
      socket.broadcast.emit('info', subdata);
  });
  </code></pre>
  
  <p>Client side</p>
  
  <pre><code>&lt;script&gt;
      var socket = io.connect('http://127.0.0.1:3000/');
      socket.on('info', function (data) {
        console.log(data);
      });
  &lt;/script&gt;
  </code></pre>