title: Socket.io 404 error
body: <p>I have followed Jeffrey way's tutorial.
  <br> Tutorial: <br><a href="https://laracasts.com/series/real-time-laravel-with-socket-io/episodes/1" rel="noreferrer">https://laracasts.com/series/real-time-laravel-with-socket-io/episodes/1</a></p>
  
  <p>this is my index.js</p>
  
  <pre><code>var app = require('express')(); 
  var server = require('http').Server(app); 
  var io = require('socket.io')(server);
  
  server.listen(3000);
  
  app.get('/', function(request, response){   
     response.sendFile(__dirname+'/index.html'); 
  });
  
  io.on('connection', function(socket){   
     console.log('A connection is made'); 
  });
  </code></pre>
  
  <p>Some people say its the version and year. The code above works on 2014 I think.</p>
  
  <p>This is my html:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;&lt;/meta&gt;
      &lt;title&gt;Chat Lesson&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;Hello world!&lt;/h1&gt;
  
      &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.4/socket.io.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          var socket = io();
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I have done a lot of research. Some people say the sequence is important but I have found so many sequence.</p>
  
  <p>My error:</p>
  
  <pre><code>GET http://chat-lesson.local:8888/socket.io/?EIO=3&amp;transport=polling&amp;t=1515636281477-74 404 (Not Found)
  </code></pre>
  
  <p>My question: <br>
  <strong>Why is it 404 not found? I have followed Jeffrey way's tutorial in every step and the tutorial was only short like 5-8mins.</strong></p>
  
  <ul>
  <li>Mamp Pro 4</li>
  <li>NPM 3.10.10</li>
  </ul>
  
  <p>I tried using <code>server.listen(8888);</code></p>
  
  <pre><code>events.js:160
        throw er; // Unhandled 'error' event
        ^
  
  Error: listen EADDRINUSE :::8888
      at Object.exports._errnoException (util.js:1022:11)
      at exports._exceptionWithHostPort (util.js:1045:20)
      at Server._listen2 (net.js:1259:14)
      at listen (net.js:1295:10)
      at Server.listen (net.js:1391:5)
      at Object.&lt;anonymous&gt; (/Users/kendantinio/Documents/Freelancer/blvnp/chat-lesson/index.js:5:8)
      at Module._compile (module.js:570:32)
      at Object.Module._extensions..js (module.js:579:10)
      at Module.load (module.js:487:32)
      at tryModuleLoad (module.js:446:12)
  </code></pre>