Web sockets

Web sockets run on top of the web socket protocol, which is a TCP protocol that provides a framework for two-way communication between the client and the server.

This is different from the standard request reply model, in which only the client can initiate a request to the server and only then, receive a response.

Web sockets work by first establishing a socket connection. This is actually done by initiating an HTTP request, so technically, it is still the client that initiates the request for a socket connection, and only after that request is fulfilled and a connection is established can the server send over information independently to the client:

The request to initiate a web socket connection comes with special headers (Connection and Upgrade) that indicate that the client wishes to switch to the web socket protocol.

The server (if it supports web sockets) then responds with corresponding headers and a 101 (switching protocol) status, along with some additional headers for security. Once this is done, the client and server can successfully communicate using the web socket protocol.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.187.121