title: How the socket.io client can detect my node server port?
body: <p>I am using the socket.io for a simple chat script.
  I created a simple server and that works without problems.
  But I have a question about client side script and that mechanism !</p>
  
  <p>For example I've this code on client file :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdn.socket.io/socket.io-1.2.0.js"&gt;&lt;/script&gt;
      &lt;script src="https://code.jquery.com/jquery-1.11.1.js"&gt;&lt;/script&gt;
      &lt;script&gt;
        $(function () {
          var socket = io();
          $('form').submit(function(){
            socket.emit('chat message', $('#m').val());
            $('#m').val('');
            return false;
          });
          socket.on('chat message', function(msg){
            $('#messages').append($('&lt;li&gt;').text(msg));
            window.scrollTo(0, document.body.scrollHeight);
          });
        });
      &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>So, How the " <a href="https://cdn.socket.io/socket.io-1.2.0.js" rel="nofollow noreferrer">https://cdn.socket.io/socket.io-1.2.0.js</a> " can detect my " server.js " file activated http port on this machine for sending requests and emits on my executed node server ?</p>
  
  <p>This is just a client side script, how this can detect a server side script and find a server port ?
  Or might be that just set a default port number on my script like as 3000 ?</p>
  
  <p>Thank you</p>