title: io.on is not working while making connection using socket.io in laravel 5.2
body: <p>i am facing problem (i really frustrated), while i connecting the io.on function. i am using express,ioredis and socket.io. redis working properly but socket.io is not working. it is'nt working.please help. </p>
  
  <pre><code>var app = require('express')();
  var server = require('http').Server(app);
  var io = require('socket.io')(server);
  var Redis = require('ioredis');
  var redis = new Redis();
  
  //port connection
  server.listen(3000);
  console.log('server listening 3000');
  
  //redis sub (working fine)
  redis.subscribe('test-channel', function () {
      console.log('Redis: test-channel subscribed');
  });
  
  //this code is not working (stop execution)
  io.on('connection', function(socket){
      console.log("new client connected");
  });
  
  
  io.on('connection', function (socket) {
      console.log("new client connected");
  
      redis.subscribe('message');
      console.log("redis start");
  
      //send message to frontend
      redis.on("message", function(channel, message) {
          console.log("mew message in queue "+ message + "channel");
          socket.emit(channel, message);
      });
      //close socket
      socket.on('disconnect', function() {
          redis.quit();
          console.log('redis disconnected!');
      });
  
  });
  </code></pre>
  
  <p>Client side </p>
  
  <pre><code>     &lt;link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"&gt;
       &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"&gt;&lt;/script&gt;
      &lt;script src="http://code.jquery.com/jquery-1.11.2.min.js"&gt;&lt;/script&gt;
      &lt;script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"&gt;&lt;/script&gt;
      &lt;script src="https://cdn.socket.io/socket.io-1.3.4.js"&gt;&lt;/script&gt;
  
     &lt;script&gt;
          var socket = io.connect('http://localhost:3000');
          socket.on('message', function (data) {
              $(".progress-bar").css('width',+data+'%');
              alert('connection established');
              $("#messages").append( "&lt;p&gt;"+data+"&lt;/p&gt;" );
          });
      &lt;/script&gt;
  </code></pre>