title: ERR_CONNECTION_REFUSED with socket.io on Node.js server
body: <p>I have a basic client-server setup with Node.js:</p>
  
  <p><strong>Server</strong></p>
  
  <pre><code>var port = 8000;
  var http = require('http');
  var express = require('express');
  var app = express();
  var server = http.createServer(app).listen(port);
  var io = require('socket.io').listen(server);
  
  app.use(express.static(__dirname + '/site'));
  app.get('/', function(req, res) {
      res.sendFile(__dirname + '/site/index.html');
  });
  
  server.listen(port, function() {
      console.log("Listening on port " + port + "...");
  });
  
  io.on('connection', function(socket) {
      console.log("A user connected");
  });
  </code></pre>
  
  <p><strong>Client</strong></p>
  
  <pre><code>var socket = io.connect("http://72.53.66.228:8000");
  
  socket.on('connect', function() {
      console.log("Connected.");
  });
  </code></pre>
  
  <p>However, I keep getting this error in my browser's console, and I'm not sure why:</p>
  
  <pre><code>GET http://72.53.66.228:8000/socket.io/?EIO=3&amp;transport=polling&amp;t=1419738402131-5 net::ERR_CONNECTION_REFUSED
  </code></pre>
  
  <p>I should also note that I'm running an Apache webserver and I'm using the ProxyPass directive to let Node.js serve off <a href="http://evades.me/CAH/" rel="nofollow">a subdirectory</a></p>