Definition: WebSocket is a communication protocol that creates a persistent, two-way connection between a client and server.
Unlike normal HTTP request/response communication, either side can send messages whenever needed after the connection is established.
Examples:
- Chat: Server instantly sends you a new message.
- Online game: Server continuously sends player positions.
- Stock dashboard: Server pushes updated prices to the browser.