"Cross origin requests are only supported for HTTP." with Node.js
<p>The following code in my client App: </p>

<pre><code>const socket = io('${location.protocol}//${location.hostname}:8090');
</code></pre>

<p>is giving me the following error in my browser:</p>

<pre><code>XMLHttpRequest cannot load http://${location.protocol}/socket.io/?EIO=3&amp;transport=polling&amp;t=LRLUtss. Cross origin requests are only supported for HTTP.
</code></pre>

<p>My client code is run using Node.js via <code>npm start</code> so "<a href="http://localhost:3000" rel="nofollow">http://localhost:3000</a>" is automatically refreshed in my browser as I update my code.</p>