A WebSocket provides a long-lived connection for exchanging messages between client and server. The connection is full-duplex, meaning data can be sent and received in realtime from both ends.