1.WebSocket in short - HeroLiu183/WebSocketLab GitHub Wiki

Why WebSocket

  • Create full-duplex connection to Server on Browser.
  • To connect server with lower overheads.
  • Need data be more real-time.

What is WebSocket

  • A communication protocol base on TCP connection.
  • Carry out full-duplex communication between Browser and Server.

How WebSocket establish connection

To establish a WebSocket connection Browser and Server should do following handshake(steps)

  1. Browser sends a Http GET request to upgrade connection, as show in header. Get_Request_To_Server
  2. Sever respond Switching Protocols then upgrade connection, from Http to WebSocket. Respones_From_Server
  3. Connection established. Connection_Established