WebSocket (WebSocket)
Websocket is a communications protocol, providing full-duplex bi-directional communication over a single TCP connection.
Websocket是一种通信协议,可通过单个TCP连接提供全双工双向通信。
To understand Websockets, first, we have to have a clear understanding of HTTP protocol cause both go hand in hand.
要了解Websocket,首先,我们必须对HTTP协议有一个清晰的了解,因为两者相互关联。

HTTP is a protocol which allows the fetching of resources, such as HTML documents. It is the foundation of any data exchange on the Web and it is a client-server protocol, which means requests are initiated by the recipient, usually the Web browser.
HTTP是一种协议 ,它允许资源,诸如HTML文档的抓取。 它是Web上任何数据交换的基础,并且是客户端-服务器协议,这意味着请求是由收件人(通常是Web浏览器)发起的。
HyperText Transfer Protocol is an application layer is a stateless application-level protocol where generally client requests information with headers using actions like GET, POST, PUT … and server sends the response back to the client and the connection is closed.
超文本传输协议是应用程序层,是一种无状态的应用程序级别协议,通常,客户端使用诸如GET,POST,PUT…之类的动作请求带有标头的信息,然后服务器将响应发送回客户端,并关闭连接。
For every communication, HTTP protocol will open a connection, data exchange then the connection is closed.
对于每次通信,HTTP协议都会打开一个连接,进行数据交换然后关闭该连接。
If the requirement is to fetch the data continuously from the server. For example fetch the realtime data for cryptocurrency exchange, gaming application or for a chat application. Then there will be multiple HTTP calls to the server.
如果要求是从服务器连续获取数据。 例如,获取实时数据以用于加密货币交换,游戏应用程序或聊天应用程序。 然后将有多个HTTP调用到服务器。
SAVE the SERVER
保存服务器

How’s the Websocket is different from traditional HTTP protocols. Websockets uses bi-directional communication and the connection will not break until the client or server decides to terminate the connection.
Websocket与传统的HTTP协议有何不同。 Websockets使用双向通信,并且在客户端或服务器决定终止连接之前ÿ