title: Use socket.io in codeigniter
body: <p>I want to use <code>socket.io</code> in codeigniter and I have followed all the process like install express and <code>socket.io</code> in root and I also have created the <code>server.js</code> file bellow</p>
  
  <p><strong>server.js</strong></p>
  
  <pre><code>var socket = require('socket.io');
  var express = require('express');
  var app = express();
  var server = require('http').createServer(app);
  var io = socket.listen(server);
  var port = process.env.PORT || 3000;
  server.listen(port, function() {
    console.log('Server listening at port %d', port);
  });
  io.on('connection', function(socket) {
    socket.on('new_message', function(data) {
      io.sockets.emit('new_message', {
        message: data.message,
        date: data.date,
        msgcount: data.msgcount
      });
    });
  });
  </code></pre>
  
  <p>When I run this <code>server.js</code> in terminal, it outputs <em>'Server listening at port 3000'</em>,
  but when I request <code>localhost:3000</code> in browser, it shows <code>Cannot GET /</code>. I do not understand this error.</p>