title: socket.io - iPad always gets a timeout, although it is connected
body: <p>I have a simple chat app with node.js and socket.io:
  <a href="http://www.adityaravishankar.com/2011/10/nowjs-node-js-tutorial-creating-multi-room-chat-server/" rel="nofollow noreferrer">tutorial full code</a></p>
  
  <p>It works perfectly if the clients enters the website from a PC. If the client uses a IPad (ios 5.1/ latest Chrome / safari) it only works sometimes.  Most of the time the webpage is loaded, then the iPad connects, but it takes so long that the server closes the connection. Then the iPad gets a new connection, but cannot really initialize a session. It periodically is disconnected and tries to reconnect again.</p>
  
  <p>Here the protocoll of socket.io:
  <img src="https://i.stack.imgur.com/KHYgu.jpg" alt="enter image description here"></p>
  
  <p>client code:</p>
  
  <pre><code>socket = io.connect(http://42.58.240.427:4000);
  socket.on('connect', function(){
  
    send('init');
  });
  </code></pre>
  
  <p>server code:</p>
  
  <pre><code>io.sockets.on('connection', function (socket) {
  
  socket.on('init', function(){
  
      console.log("Good morning new User");
  });
  
  
  socket.on('disconnect', function(){
  
      requesthandler['disconnect'](socket, io);
  
  });
  </code></pre>