title: Laravel 5 - Homestead - Redis - NodeJs - Socket IO not playing nicely
body: <p>I am attempting to get some real time notifications into my Laravel 5 app. Building locally on a vagrant box with Homestead.</p>
  
  <p>I can not work out what the issue is with the following set up.</p>
  
  <p>My server.js is as follows ...</p>
  
  <pre><code>var app = require('express')();
  var server = require('http').Server(app);
  var io = require('socket.io')(server);
  var redis = require('redis');
  
  server.listen(3000);
  
  io.on('connection', function (socket) {
  
    var redisClient = redis.createClient();
    redisClient.subscribe('message');
  
    redisClient.on("message", function(channel, message) {
      socket.emit(channel, message);
    });
  
    socket.on('disconnect', function() {
      redisClient.quit();
    });
  
  });
  </code></pre>
  
  <p>Then my client code is to subscribe:</p>
  
  <pre><code>&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://127.0.0.1:3000');
  socket.on('message', function (data) {
     alert(data);
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Firebug keeps returning:</p>
  
  <blockquote>
    <p>GET <a href="http://127.0.0.1/socket.io/?EIO=3&amp;transport=polling&amp;t=1430825965165-1" rel="nofollow">http://127.0.0.1/socket.io/?EIO=3&amp;transport=polling&amp;t=1430825965165-1</a>
    Aborted</p>
  </blockquote>
  
  <p>Chrome tools shows me the following:</p>
  
  <blockquote>
    <p><a href="http://127.0.0.1:3000/socket.io/?EIO=3&amp;transport=polling&amp;t=1430826106108-3" rel="nofollow">http://127.0.0.1:3000/socket.io/?EIO=3&amp;transport=polling&amp;t=1430826106108-3</a> net::ERR_CONNECTION_REFUSED</p>
  </blockquote>
  
  <p>Pretty new to NodeJs and very confused. Spent a good 4 hours now trying to work it out.</p>
  
  <p>Any pointers?</p>
  
  <p>many thanks, Dean.</p>