title: Cannot get /socket.io/socket.io.js on client application
body: <p>My <strong>server</strong> side application is hosted on <code>heroku</code>: <a href="https://shielded-dusk-72399.herokuapp.com/" rel="nofollow noreferrer">https://shielded-dusk-72399.herokuapp.com/</a></p>
  
  <p>Relevant code looks like this:</p>
  
  <pre><code>const
      express = require('express'),
      app = express(),
      server = require('http').createServer(app),
      io = require('socket.io').listen(server),
      port = process.env.PORT || 8080
  
  server.listen(port, (err) =&gt; {
    console.log(err || 'listening on my very special port ' + port)
  })
  </code></pre>
  
  <p>In my heroku logs this gets logged: <code>"listening on my very special port 28428"</code></p>
  
  <p>Now on my <strong>client</strong> application:</p>
  
  <p>Currently my client application is running on port 8080</p>
  
  <p>In my <code>index.html</code>: </p>
  
  <pre><code>&lt;script&gt;/socket.io/socket.io.js" charset="utf-8"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>When I go to <code>localhost:8080</code> I get the following errors:</p>
  
  <pre><code>Cannot GET http://localhost:8080/socket.io/socket.io.js
  </code></pre>
  
  <p>Other Attempts:</p>
  
  <pre><code>&lt;script src="https://shielded-dusk-72399.herokuapp.com:28428/socket.io/socket.io.js" charset="utf-8"&gt;&lt;/script&gt;
  
  Cannot GET https://shielded-dusk-72399.herokuapp.com:28428/socket.io/socket.io.js net::ERR_CONNECTION_REFUSED
  
  &lt;script src="https://shielded-dusk-72399.herokuapp.com:8080/socket.io/socket.io.js" charset="utf-8"&gt;&lt;/script&gt;
  
  Cannot GET https://shielded-dusk-72399.herokuapp.com:8080/socket.io/socket.io.js net::ERR_CONNECTION_REFUSED
  </code></pre>
  
  <p>And then I copied <code>./node_modules/socket.io-client/dist/socket.io.js</code> to <code>resources/js</code> and get this error:</p>
  
  <pre><code>Cannot GET http://localhost:8080/resources/js/socket.io.js 404 (Not Found)
  </code></pre>
  
  <p>Any ideas? </p>
  
  <p>I've used these all as references and still coming up short:</p>
  
  <p><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></p>
  
  <p><a href="https://stackoverflow.com/questions/23179827/node-js-socket-io-socket-io-js-not-found-express-4-0">Node.js /socket.io/socket.io.js not found express 4.0</a></p>
  
  <p><a href="https://stackoverflow.com/questions/21365044/cant-get-socket-io-js">Can&#39;t get socket.io.js</a></p>