title: How ServerSocket is able to receive HTTP requests?
body: <p>I have implemented simple client-server program using socket programming. Here is my server code snippet,  </p>
  
  <pre><code>ServerSocket listner = new ServerSocket(9000);
  while(true){
  Socket socket = listner.accept();
  // here a new thread is spawn for each request Which prints 
  // the data received from client using socket input stream
  }
  </code></pre>
  
  <p>When the server is up and URL(<a href="http://localhost:9000" rel="nofollow noreferrer">http://localhost:9000</a>) is hit from the browser, I can see HTTP get request is printed on the console.  </p>
  
  <p>As far as I know HTTP listens to port 80(i.e., all incoming HTTP request comes via this port). My question is, how come http requests are received via port 9000. If the URL I'm using tells to ignore (or may be by pass) port 80? Then, how to implement server program using sockets which listens to standard HTTP port:80(I mean by htting URL <a href="http://localhost/" rel="nofollow noreferrer">http://localhost/</a>).</p>