title: socket.io can connect in local, but cant connect in real live server
body: <p>When I test in local, it works, but when I put it to real live server, after some testing with the code below, I found that client side will only connect to my local <code>socket.js</code> not server
  <code>socket.js</code></p>
  
  <pre><code>http.listen(8080, function(){
      console.log('Listening on Port 8080');
  });
  </code></pre>
  
  <p><strong>index.blade.php</strong></p>
  
  <pre><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.1.1/socket.io.js"&gt;&lt;/script&gt;
  $(document).ready(function() {
      var socket = io.connect('localhost:8080');
  });
  </code></pre>
  
  <p>so I change index.blade.php connect to my <code>$ipaddress</code>, and <code>cosole.log</code> the status of connected: false still cant connect  </p>
  
  <pre><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.1.1/socket.io.js"&gt;&lt;/script&gt;
  $(document).ready(function() {
      var socket = io.connect($ipaddress);
      console.log(socket);
  });
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/kcRgR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kcRgR.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/gtxUs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gtxUs.png" alt="enter image description here"></a></p>