title: Error socket.io net::ERR_CONNECTION_TIMED_OUT
body: <p>I have a website with a real time chat it works on localhost without error but on server I get this error.</p>
  
  <p><code>https://app.webku.org:8181/socket.io/?EIO=3&amp;transport=polling&amp;t=MZpzI2p
  net::ERR_CONNECTION_TIMED_OUT</code></p>
  
  <p>this is my server.js</p>
  
  <pre><code>var express = require('express');
  var http = require('http');
  var app = express();
  var server = http.createServer(app);
  server.listen(8181);
  var io = require('socket.io').listen(server);
  
  io.on('connection', function(socket){
    socket.on('new_chats', function(data){
      io.emit('new_chats', { ua: data.ua, message: data.message });
    });
  
    socket.on('disconnect', function(){
      console.log('State disconnected');
    });
  });
  </code></pre>
  
  <p>and this is on client side</p>
  
  <pre><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.2.0/socket.io.js" charset="utf-8"&gt;&lt;/script&gt;
  &lt;script&gt;
          var socket = io.connect('https://app.webku.org:8181');
  
          $(document).on('keypress', function(e){
             var key = e.keyCode || e.which;
             var msg = 'testing message';
             if( key == 13 ){
                socket.emit('new_chats', { ua: &lt;%= user[0].user_id %&gt;, message: msg });
             }
          });
  
      socket.on('new_chats', function(data){
              var d = new Date();
              var t = d.getHours() +':'+ d.getMinutes();
  
              var tpos = 'text-left';
              if(data.ua == &lt;%= user[0].user_id %&gt;){ tpos = 'text-right'; }
  
              $('#_icard'+ua).find('.ibody ul').append(
                '&lt;li class="'+tpos+'"&gt;' +
                  '&lt;div&gt; '+data.message+' &lt;small class="small"&gt;'+t+'&lt;/small&gt; &lt;/div&gt;' +
                '&lt;/li&gt;'
              );
  
            });
  &lt;/script&gt;
  </code></pre>
  
  <p>How I can solve this problem? thank you so much.</p>