DEV Community

Cover image for Web Sockets : The Handshake Technology
Shahnawaz Alam
Shahnawaz Alam

Posted on

Web Sockets : The Handshake Technology

We all have used Instagram or WhatsApp to have a healthy chat with our friends. Being a developer, I always wondered how this happens so fast without reloading. The answer is Web Sockets.

Web Sockets vs HTTP

Why Web Sockets you might ask? Well what happens in HTTP is that a connection is established and once the request result process is completed, the connection is terminated.
So if we use this process for real time messaging, it would take some time to create new connections, thus making our chatting process slower. No one would like that, right?

This is where Web Sockets come in. The major difference is that the connection once established, is not destroyed until there is no more need for it.

Pipelines in Web Sockets

This might feel like one of those tech terminologies which scare us. But in simpler terms, pipelines in tech are same as real life pipelines. A connection through which things can be passed in any direction easily.
This is how Web Sockets work, through pipelines.

How web sockets work

There are many libraries that help with the implementation of Web Sockets like Socket.io

Top comments (0)