Computers and the Internet · Talking at scale
What is a WebSocket?
A WebSocket turns one HTTP request into a long-lived two-way connection, so the server can push a chat message or a new score the moment it exists instead of waiting to be asked.
- Time22 min
- LevelDeveloper
- Experiments1 live
- Check6 questions







Server agrees 101 Switching Protocols; HTTP is over on this connection.
Silence no news, no traffic; the server keeps a socket and some memory.
Push the feed reports a six; the server sends one small frame at once.
Your messages such as {"runs":130,"wickets":3}; the format is up to you.
WebSocket frames a 2 to 14 byte header: type, length, mask.
TLS encryption, for wss:// addresses.
IP packets across the internet.