title: Socket.io v3.0.4 not connecting, v2.3 does work
body: <p><strong>Summary</strong></p>
  <p>I have basic sample code which works in socket.io 2.3 which does not work in socket.io 3.0, I want to understand what I need to change.</p>
  <p><strong>Full Description</strong></p>
  <p>I have a node.js / react project and I wanted to use socket.io.  To do this, I implemented the example code from <a href="https://www.valentinog.com/blog/socket-react/" rel="nofollow noreferrer">this article</a>, using socket.io v3.0.4, which follows.</p>
  <p>Server side:</p>
  <pre><code>const http = require(&quot;http&quot;);
  const socketIo = require(&quot;socket.io&quot;);
  
  const port = process.env.PORT || 4001;
  const index = require(&quot;./routes/index&quot;);
  
  const app = express();
  app.use(index);
  
  const server = http.createServer(app);
  
  const io = socketIo(server);
  
  let interval;
  
  io.on(&quot;connection&quot;, (socket) =&gt; {
    console.log(&quot;New client connected&quot;);
    if (interval) {
      clearInterval(interval);
    }
    interval = setInterval(() =&gt; getApiAndEmit(socket), 1000);
    socket.on(&quot;disconnect&quot;, () =&gt; {
      console.log(&quot;Client disconnected&quot;);
      clearInterval(interval);
    });
  });
  
  const getApiAndEmit = socket =&gt; {
    const response = new Date();
    // Emitting a new message. Will be consumed by the client
    socket.emit(&quot;FromAPI&quot;, response);
  };
  
  server.listen(port, () =&gt; console.log(`Listening on port ${port}`));
  </code></pre>
  <p>Client Side:</p>
  <pre><code>import React, { useState, useEffect } from &quot;react&quot;;
  import socketIOClient from &quot;socket.io-client&quot;;
  const ENDPOINT = &quot;http://127.0.0.1:4001&quot;;
  
  function App() {
    const [response, setResponse] = useState(&quot;&quot;);
  
    useEffect(() =&gt; {
      const socket = socketIOClient(ENDPOINT);
      socket.on(&quot;FromAPI&quot;, data =&gt; {
        setResponse(data);
      });
    }, []);
  
    return (
      &lt;p&gt;
        It's &lt;time dateTime={response}&gt;{response}&lt;/time&gt;
      &lt;/p&gt;
    );
  }
  
  export default App;
  </code></pre>
  <p>on the server, I was receiving the error
  <code>socket.io:client client close with reason ping timeout</code>
  which led me to <a href="https://stackoverflow.com/questions/64801255/socket-io-client-close-with-reason-ping-timeout">this article</a>, which implied a version issue.</p>
  <p>Based on that, I've attempted a few things, but specifically, I was running <code>socket.io</code> and <code>socket.io-client</code> both version 3.0.4.  I uninstalled and reinstalled v 2.3.0/2.3.1.  It now works flawlessly.</p>
  <p>So my question is: what do I need to change to make this work with the more recent version of socket.io.</p>