How to use io.socket in Node - Express Framework
<p>I am trying to use io.socket onto a node js application. </p>

<p>In server side: </p>

<pre><code> io.on('connection', function(client){
    client.on('event', function(data){console.log("I am here")});
    client.on('disconnect', function(){});
 });
</code></pre>

<p>In client side:</p>

<pre><code>var socket = io.connect();
socket.on('news', function (data) {
  console.log(data);
  socket.emit('my other event', { my: 'data' });
});

server.listen('80');
app.listen(port);
</code></pre>

<p>But I think I have some problem with the port because the port is defined under folder bin/www. </p>

<p>when i try to upload the code into heroku, the heroku app is broken down. It was working fine in localhost. </p>