[This article is original, if reproduced, please indicate the source http://blog.csdn.net/yl02520/article/]
WebSocket is based on TCP like the HTTP protocol, so they are all reliable protocols, and the WebSocket send function that Web developers invoke is eventually transmitted through TCP's system interface in browser implementations. WebSocket and HTTP protocols are both application-level protocols, so what's the relationship between them? The answer is yes, websocket the data is transmitted over the HTTP protocol when creating a handshake connection, as we saw in the previous section, "Get/chat http/1.1", where only a few simple fields of the HTTP protocol are used. However, after the connection is established, the real data transfer phase is not required for HTTP protocol participation.
The specific relationship can refer to the following figure: