com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links' is unknown.

WebSockets

What is a webSocket?

webSocket is a protocol that is designed to stream data using port 80 and port 443 and it comes as a part of HTML5. Furthermore, webSocket is a protocol providing full-duplex communications channels over a single TCP connection. Unlike TCP sockets, webSockets can operate on standard web ports. As a result, there is no hassle of opening ports for applications, worrying about firewalls and virus-guards etc.

Evolution of webSockets

In the past websites were just used to share information. All most all the websites only included words and images and there were no such things called commercial websites. Moreover, when it came to hardware, web servers had limited memory and storage, but it had to scale to serve a large number of users. As a result, to cope with these requirements engineers came up with a protocol called HTTP. This was purely based on the request/response paradigm. Whenever there is a new request, the web server creates a new socket and serves the request with a response and as soon as the response is sent the server closes the socket and reacquires the resources that were allocated.

This was fine before people came up with RIAs which gave birth to a large number of commercial websites. As time went on both software and hardware kept on evolving. Now with the help of AJAX and SOAP web applications are able to send asynchronous request to web servers. In addition, web servers are now rich with memory, storage and high processing power. This provided the perfect platform for RIAs and consequently RIAs became more and more like standalone applications. At this point HTTP became inadequate and this gave birth to webSockets.

How webSockets work

The following diagram depicts how a webSocket communication is initiated.

Initial webSocket handshake request is done using HTTP. Then upon successful handshake, both the web client and server upgrade their communication protocol to webSocket. Thereafter, communication is done using webSocket frames. The webSocket communication does not have to be request/response. webSocket frames can flow back and forth as they wish like a normal TCP socket connection.

The initial handshake request which is sent using the HTTP protocol has to include certain header fields such as the origin header, HTTP compliant version header, webSocket subversion header and more. These headers and frames can be seen with the help of google-chrome's developer tool and you can try this out using the demo site to check webSocket communication.

webSockets and WSO2 DS

Jaggery webSocket enables full duplex transmission and it supports webSocket specification. It defines an API establishing "socket" connections between a web browser and a server. This results in a persistent connection between the client and the server, and both parties can start sending data at any time.

Users can use various gadgets that are available in WSO2 Enterprise Store, to create their own customized dashboards using WSO2 Dashboard Server (WSO2 DS). The WSO2 DS dashboards require real-time data. As a result, webSockets are enabled in WSO2 DS gadgets to ensure bi-directional real-time communication between servers and clients.

What's Next?

If you want to try out how to use webSockets with WSO2 DS, see Sample 2 - webSocket Support.

com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.