CALL US ⁄ ⁄   +61 3 9995 0765



bring real time data into business

Since the early day of the Internet, the web mostly consisted of single, simple text pages linked to each other. Users back then came to the World Wide Web just to read and/or retrieve information that had little or no images. That changed a little with the introduction of Web 2.0 movement in 2004 which encourage user’s engagement with each others via collaboration, social media dialogue that put strong emphasis on user generated data. Moving on to 2014, the advancement of new non-blocking IO with the support for HTML 5 Web socket on modern browsers, businesses should start looking at how they can utilize the benefit of two-way communication that WebSocket protocol brings.


The standard model of interaction between a web user agent such as a browser and a web server such as IIS, Apache is that the user agent makes HTTP requests and the server makes a single reply to each one. In the case of a browser, the request is made by clicking on a link, entering a URL into the address bar, clicking on the forward or back buttons, etc. The response is treated as a new page and is loaded into a browser window.


This traditional model has many drawbacks. The first is that each request opens and closes a new TCP connection. HTTP 1.1 solved this by allowing persistent connections, so that a connection could be held open for a short period to allow for multiple requests (e.g. for images) to be made on the same server. While HTTP 1.1 persistent connections alleviated the problem of slow loading of a page with many images, it does not improve the interaction model. Even with forms, the model is still that of submitting the form and displaying the response as a new page. JavaScript helps in allowing error checking to be performed on form data before submission, but does not change the model.


AJAX (Asynchronous JavaScript and XML) made a significant advancement to the user interaction model. This allowed a browser to make a request and just use the response to update the display in place using the HTML Document Object Model (DOM). But again the interaction model is the same. AJAX just affects how the browser manages the returned pages. There is no explicit extra support in Go for AJAX, as none is needed: the HTTP server just sees an ordinary HTTP POST request with possibly some XML or JSON data, and this can be dealt with using techniques already discussed.


All of these are still browser to server communication. What is missing is server initiated communications to the browser. In fact, this can now be filled by Web socket protocol: the browser (or any user agent) keeps open a long-lived TCP connection to a Web socket server. The TCP connection allows either side to send arbitrary packets, so any application protocol can be used on a web socket.


Other benefit of the web socket’s are the reduction of data and the latency on the network since the overhead of initiate the http connections are smaller. According to Ian Hickson, the html5 specification lead, Web socket can:


“Reduce kilobytes of data to 2 bytes…and reducing latency from 150ms to 50ms is far more than marginal. In fact, these two factors alone are enough to make Web Sockets seriously interesting to Google.”


Source :


Indeed the Web Socket protocol has opened the doors to many applications which were not feasible (or were hard to achieve for the desired performance) such as

  • Media chat
  • Logging analysis
  • Real time data display
  • Collaboration software to enable multiple users to view/edit same document
  • Interactive educational tool
  • Location based applications where user can have data on their mobile device as soon as their location is sent back to server


Below is an example of web socket enabled application where multiple mobile client can communicate with each other via a web socket server.

Bringing real-time data into your business

There is an old saying “The sky is the limit” and the new, interesting and light-weight way to communicate with end user via Web socket provides many opportunities to enhance the way your business communicates to your users. Talk to us today and let us help your business utilise these new technologies.

Be the first to post on the blog

Leave a Reply


Back to blog