title: Node.js /socket.io/socket.io.js not found express 4.0
body: <p>So I'm trying to get chat working on my website, and when I was testing locally it worked great, because port 8080 on my localhost was available and all that good stuff. But now I pushed my code to my Heroku app, and when I try and load my chat page, I get the error stating that it can't get localhost:8080/socket.io/socket.io.js. </p>
  
  <p>I've seen <a href="https://stackoverflow.com/questions/19426882/node-js-socket-io-socket-io-js-not-found">node.js /socket.io/socket.io.js not found</a>
  and tried the suggestions, but none worked, even moving the socket.io.js file into a resource file did not work. I'm guessing this is because I'm using express 4.0?</p>
  
  <p>Any help would be appreciated
  Thanks</p>
  
  <p>Edit:
  So to add more details, since my question could seem a little vague, here is my relevant app.js code:</p>
  
  <pre><code> var client = require('socket.io').listen(8080).sockets;
  </code></pre>
  
  <p>In my jade file for the chat page, I have:</p>
  
  <pre><code> script (src = `'http://localhost:8080/socket.io/socket.io.js`')
  </code></pre>
  
  <p>and later on</p>
  
  <pre><code> var socket = io.connect(`'http://localhost:8080`');
  </code></pre>
  
  <p>and all this works on localhost (I load up on port 5000, socket.io is connected to port 8080). I do this using 'foreman start' with the heroku toolbelt. </p>
  
  <p>When I try and change these to work on heroku, it breaks and I'm not sure how to fix it. I hope this clarifies the question a bit. </p>
  
  <p>Edit 2:
  I'm running:
  express 4.0.0</p>
  
  <p>socket.io 0.9.16</p>
  
  <p>node 0.10.x</p>
  
  <p>Thanks</p>