[go: up one dir, main page]

0% found this document useful (0 votes)
84 views1 page

Websockets

Uploaded by

namedspheres
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views1 page

Websockets

Uploaded by

namedspheres
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

WebSocket

WebSocket is a full-duplex communication protocol that enables a persistent


connection between the client and server, allowing both to send and receive
messages in real time.

Key Features:
Full-Duplex Communication: Both the client and server can send messages to each
other independently.
Persistent Connection: Once established, the connection stays open, reducing the
overhead of repeatedly establishing new HTTP connections.
Binary or Text Data: WebSocket supports both binary and text-based communication.
Custom Protocol: While it starts with an HTTP/HTTPS handshake, it upgrades the
connection to the WebSocket protocol (e.g., ws:// or wss:// for secure WebSocket).
How It Works:
The client sends an HTTP request to the server with an Upgrade header to establish
a WebSocket connection.
If the server accepts the upgrade, the connection switches from HTTP to WebSocket.
After the connection is established, messages can flow in both directions until the
connection is closed.

Use Cases:
Chat applications.
Online gaming.
Financial tickers (e.g., stock price updates).
Collaborative tools (e.g., Google Docs).

You might also like