title: What's the difference between WebSocket and plain socket communication?
body: <p>According to the <a href="http://en.wikipedia.org/wiki/WebSocket" rel="noreferrer">Wikipedia</a>, the only relationship between HTTP and WebSocket is an extra handshake in the form of a <code>Upgrade HTTP request</code>. And after that, it seems the browser and HTTP server will just communicate in an old C/S paradigm over a plain socket.</p>
  
  <p>So my questions are:</p>
  
  <ul>
  <li>Is WebSocket just a plain socket communication?</li>
  <li>It is called <code>Web</code>Socket because the communication targets server's 80 port? i.e. <code>port 80</code> is just synonymous to <code>web</code>.</li>
  <li>The 80 port is on the server side, what ports are used in client?</li>
  <li>If it is just like plain socket communication between a browser and a server, why WebSocket is not implemented in browsers until recently? It seems nothing but a little C/S extension to the B/S paradigm.</li>
  </ul>
  
  <h2>ADD 1 (9:46 AM 5/23/2017)</h2>
  
  <p>Today, I revisited @jfriend00's excellent answer. Let'me summarize my understanding.</p>
  
  <ul>
  <li>Socket is just a end-2-end communication <strong>channel</strong>. It doesn't impose restriction on what communication <strong>protocol</strong> can be used on it.</li>
  <li>webSocket, like HTTP, is just another standalone communication protocol. Though the word <em>socket</em> in the name confused me at first.</li>
  <li>webSocket leverages the same port number as HTTP for that if we can communicate through HTTP, we can be sure webSocket communication can be made. Becuase since the channel is through, we can pick the most appropriate way we talking along the channel.</li>
  </ul>