title: net::ERR_CONNECTION_REFUSED in socket.io connection
body: <p>I am trying to make a chat app, but when trying to establish the connection I get the following error in the frontend console.</p>
  <pre><code>polling-xhr.js:198 GET http://localhost:8900/socket.io/?EIO=4&amp;transport=polling&amp;t=NjM8sny net::ERR_CONNECTION_REFUSED
  </code></pre>
  <p>The code in the frontend is the following:</p>
  <pre><code>        useEffect(() =&gt; {
      socket.current = io.connect(&quot;http://localhost:8900/&quot;);
      socket.current.on(&quot;getMessage&quot;, (data) =&gt; {
        setArrivalMessage({
          sender: data.senderId,
          text: data.text,
          createdAt: Date.now(),
        });
      });
  }, []);
  </code></pre>
  <p>The code in the backend is:</p>
  <pre><code>const io = require('socket.io')(8900,{
  cors: {
      origin:'http://localhost:3000',
      credentials:true,
      allowedHeaders: [&quot;access-token&quot;],
  },
  </code></pre>
  <p>});</p>
  <p>I would like to know if there is any error in my code or if I am missing some type of module.</p>