init
This commit is contained in:
commit
c5cd492449
475 changed files with 27928 additions and 0 deletions
23
technology/internet/WebSocket.md
Normal file
23
technology/internet/WebSocket.md
Normal file
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
obj: concept
|
||||
wiki: https://en.wikipedia.org/wiki/WebSocket
|
||||
rfc: https://datatracker.ietf.org/doc/html/rfc6455
|
||||
website: https://websockets.spec.whatwg.org
|
||||
---
|
||||
|
||||
# WebSocket
|
||||
WebSockets provide a bidirectional communication channel over a single, long-lived connection. This enables real-time, low-latency data exchange between a client and a server.
|
||||
|
||||
## WebSocket Protocol
|
||||
### 1. **WebSocket Handshake:**
|
||||
The WebSocket handshake is an [HTTP](HTTP.md)-based protocol that establishes a connection between the client and server. Once established, the connection switches to the WebSocket protocol.
|
||||
### 2. **WebSocket Frames:**
|
||||
Messages in WebSockets are sent as frames. Frames can be text, binary, or control frames used for connection management.
|
||||
|
||||
## Usage and Benefits
|
||||
### 1. **Real-Time Applications:**
|
||||
WebSockets are ideal for real-time applications like live chats, online gaming, financial trading, and collaborative tools.
|
||||
### 2. **Reduced Latency:**
|
||||
The persistent connection minimizes latency compared to traditional [HTTP](HTTP.md), making WebSockets suitable for applications requiring low-latency communication.
|
||||
### 3. **Efficient Data Transfer:**
|
||||
WebSockets use a compact binary frame format, reducing the overhead associated with text-based protocols.
|
Loading…
Add table
Add a link
Reference in a new issue