IOE - Module 4 - WebSockets
IOE - Module 4 - WebSockets
Module 4
WebSocket:
✓ WebSocket is a client-server communication protocol running on top of your TCP (Transmission
Control Protocol).
✓ It supports bi-directional full duplex message exchanges between a client (usually a web browser)
and a web server with little overhead compared to HTTP.
✓ This makes it an ideal protocol for applications that requires “real-time” and “low-latency”
message exchange and asynchronous updates.
✓ The protocol automatically upgrades to WebSocket when the Initial HTTP Handshake (Upgrade)
is successful. Please see the next section on how this upgrade works.
✓ The client can send messages to WebServer. The WebServer can push messages to the Client.
Both can send and receive messages at the same time. In effect, this protocol is full-duplex and bi-
directional.
✓ Connection is persistent so it does not get created/destroyed for each request/response cycle. This
makes it ideal for “Real-Time” applications as there is less overhead. If one of the participants
disconnects then it closes the connection and does not get reconnected.
This protocol defines a full duplex communication from the ground up. Web sockets take a step forward
in bringing desktop rich functionalities to the web browsers. It represents an evolution, which was awaited
for a long time in client/server web technology.
• Web socket protocol is being standardized, which means real time communication between web
servers and clients is possible with the help of this protocol.
• Web sockets are transforming to cross platform standard for real time communication between a
client and the server.
• This standard enables new kind of the applications. Businesses for real time web application can
speed up with the help of this technology.
• The biggest advantage of Web Socket is it provides a two-way communication (full duplex) over
a single TCP connection.
• The latest specification of Web Socket protocol is defined as RFC 6455 – a proposed standard.
• RFC 6455 is supported by various browsers like Internet Explorer, Mozilla Firefox, Google
Chrome, Safari, and Opera.