title: Flutter Socket io disconnects after some seconds
body: <p>Am using a local socket server using express which is expose to the internet using ngrok. This is the server code:</p>
  <pre><code>const app = require('express')();
  const http = require('http').createServer(app);
  
  app.get('/', (req, res) =&gt; {
     res.send(&quot;Node Server is running. Yay!!&quot;);
  });
  
  //Socket Logic
  const socketio = require('socket.io')(http)
  socketio.on(&quot;connection&quot;, (userSocket) =&gt; {
     console.log('Connected to socket');
  });
  
  http.listen(3000, () =&gt; {
   console.log('listening on port 3000');
  });
  </code></pre>
  <p>and my connection logic is:</p>
  <pre><code> void connectToServer() {
      try {
        socket = io('https://fa6387728fcd.ngrok.io', &lt;String, dynamic&gt;{
          'transports': ['websocket'],
          'autoConnect': false,
        });
  
        // Connect to websocket
        socket.connect();
  
        // Handle socket events
        socket.on('connect', (data) =&gt; print('Connected to socket server'));
        socket.on('disconnect', (reason) =&gt; print('disconnected $reason'));
        socket.on('error', (err) =&gt; print('Error: $err'));
      } catch (e) {
        print(e.toString());
      }
    }
  
  </code></pre>
  <p>But i keep getting <code> disconnected ping timeout</code> or sometimes i get <code>disconnected transport close</code></p>