Ask the Authors on Google Developers Live: The Definitive Guide to HTML5 WebSocket

We’re excited to work with Google to talk about The Definitive Guide to HTML5 WebSocket, show some WebSocket demos, and answer your questions about WebSocket at Google Developer’s Live on Tuesday, 19 March 2013 at 1p PDT.developers_live-53Peter Moskovits (Head of Real-Time Solutions at Kaazing), Frank Salim (Software Engineer at Google), and Vanessa Wang (Manager of Technical Publications at Kaazing) will be interviewed live at GDL by Peter Lubbers (Chrome Developer Relations Program Manager at Google). You can start submitting your questions now.

To take a peek at the book, see our post from February.

Peter, Frank, and Vanessa will also join Google’s performance guru, Ilya Grigorik, at the next San Francisco HTML5 User Group meetup on 21 March 2013, at Say Media’s headquarters in San Francisco. Ilya wrote the foreword to our book, and will be talking about mobile app performance. We’ll also host a book signing for our book, and provide tasty appetizers and drinks to keep you refreshed during our book signing party.

Posted in Book, documentation, html5, Kaazing, Security, Uncategorized, WebSocket | Tagged , , , , | Leave a comment

Incredible Interactive WebSocket Demos and Book Signing at SXSW

If you’re attending South by Southwest in Austin, TX, we’d love to catch up with you and show some of our jaw-dropping WebSocket demos.

sxswlogo

Vanessa Wang and Peter Moskovits are scheduled to sign their newly published book, The Definitive Guide to HTML5 WebSocket, on Friday, March 8, 2013, at 4pm at the SX Bookstore. If you cannot make it on Friday, there will be another signing at the Apress booth on Monday, March 11, 2013, at 11:30am.

Bookstore_ws-5Stop by at stand 428 and leave your card to enter the raffle for laptop cases and more. Be sure to bring your smartphone and tablet for first-hand experience.

iPadMini

Posted in Book, Events, Kaazing, WebSocket | Leave a comment

Outbid: Live Social Online Auctions

Kaazing and Outbid announced today that Kaazing WebSocket Server HTML5 Edition 3.5 is powering Outbid’s real-time bidding and live chat of the online auction service on outbid.com.  Read the press release.

Outbid is the next generation of online auctions for the web and mobile. It combines the theater and transparency of live event auctions with the best of what the web can offer, including accessibility, global reach, convenience, and compelling social and gaming interactivity. Similar to a live offline auction, Outbid recreates the traditional auction experience by combining an auctioneer chosen by the seller with bidders who meet in a lobby to mingle, review auction items, chat, and either join or simply watch as the action unfolds.

outbid

Posted in html5, Kaazing, WebSocket | Leave a comment

The Definitive Guide to HTML5 WebSocket is Now Available

A little while ago, we announced that our book, The Definitive Guide to HTML5 WebSocket, was on the horizon. Frank Salim, Peter Moskovits, and I are super excited to share the news that we finished writing the book and it’s NOW AVAILABLE. Yay!

The Definitive Guide to HTML5 WebSocket

The Definitive Guide to HTML5 WebSocket

This book provides an introduction to WebSocket, then describes the WebSocket API and Protocol and provides hands-on examples. We deep dive into three use cases for WebSocket, all using higher-level standard protocols (text and binary) over WebSocket. We walk through building a grown-up version of a chat application using XMPP/WS, a rock-paper-scissors game using pub-sub and STOMP/WS, and desktop sharing using RFB/WS (VNC). Finally, we examine security and deployment considerations. The book comes with the source code you need to get the demos up and running, as well as an easy-to-use VM with screencasts that show you what you’ll build.

Watch two of the authors, Vanessa and Peter, give a 90 second overview of the book:

Here’s an excerpt from Chapter 1, “Introduction to HTML5 WebSocket” from The Definitive Guide to HTML5 WebSocket (Apress, 2013):

WebSocket is about Performance

WebSocket makes real-time communication much more efficient.

You can always use polling (and sometimes even streaming) over HTTP to receive notifications over HTTP. However, WebSocket saves bandwidth, CPU power, and latency.

WebSocket is an innovation in performance.

WebSocket is about Simplicity

WebSocket makes communication between a client and server over the Web much simpler.

Those who have already gone through the headache of establishing real-time communication in pre-WebSocket architectures know that techniques for real-time notification over HTTP are overly complicated. Maintaining session state across stateless requests adds complexity. Cross-origin AJAX is convoluted, processing ordered requests with AJAX requires special consideration, and communicating with AJAX is complicated. Every attempt to stretch HTTP into use cases for which it was not designed increases software complexity.

WebSocket enables you to dramatically simplify connection-oriented communication in real-time applications.

WebSocket is about Standards

WebSocket is an underlying network protocol that enables you to build other standard protocols on top of it.

Many web applications are essentially monolithic. Most AJAX applications typically consist of tightly coupled client and server components. Because WebSocket naturally supports the concept of higher-level application protocols, you can more flexibly evolve clients and servers independently of one another. Supporting these higher-level protocols enables modularity and encourages the development of reusable components. For example, you can use the same XMPP over WebSocket client to sign onto different chat servers because all XMPP servers understand the same standard protocol.

WebSocket is an innovation in interoperable web applications.

WebSocket is about HTML5

WebSocket is part of an effort to provide advanced capabilities to HTML5 applications in order to compete with other platforms.

Every operating system needs networking capabilities. The ability for applications to open sockets and communicate with other hosts is a core feature provided by every major platform. HTML5 is, in many ways, a trend toward making web browsers fully capable application platforms that are analogous to operating systems. Low-level networking APIs like sockets would not mesh with the origin security model or API design style of the Web. WebSocket provides TCP-style networking for HTML5 applications without wrecking browser security and it has a modern JavaScript API.

WebSocket is a key component of the HTML5 platform and an incredibly powerful tool for developers.

You Need WebSocket!

Simply put, you need WebSocket to build world-class web applications. WebSocket addresses the major deficiencies that make HTTP unsuitable for real-time communication. The asynchronous, bidirectional communication patterns enabled by WebSocket are a return to the general flexibility afforded by transport layer protocols on the Internet.

Think about all the great ways you can use WebSocket and build true real-time functionality into your applications, like chat, collaborative document editing, massively multiplayer online (MMO) games, stock trading applications … the list goes on. We’ll take a look at specific applications later in this book.

Published by Apress and available on Amazon, this is the first printed book (also available as an ebook, for the Kindle, as a Nook book, and other formats) fully dedicated to the WebSocket technology.

After reading this book, we hope you’ll be as excited and inspired to use WebSocket as we are.

Thanks to our colleagues Steve Atkinson and Frank Greco for being our detailed and excellent reviewers!

Posted in Book, html5, JMS, Kaazing, WebSocket | Tagged , , , | 8 Comments

Society for Technical Communications Grants Kaazing a Merit Award

Kaazing’s Setting Up Kaazing WebSocket Gateway – HTML5 Edition document won a Society of Technical Communications Merit Award for meeting high standards in documentation and applying technical communication principles in a highly proficient manner. This setup guide shows you how you can set up Kaazing’s full-duplex, enterprise, Web communications platform in your environment, and utilizes navigation elements to help you quickly access the information you need to configure the Gateway.

Setting Up Kaazing WebSocket Gateway

Setting Up Kaazing WebSocket Gateway


Congratulations to my fellow writers at Kaazing, Viv Schupmann and Michael Cretzman, on this great achievement!

Posted in documentation, Kaazing | Tagged , , , | 6 Comments

One line of code that changed the Web forever

After presenting to a partner of Kaazing last week I got asked what impact the emerging WebSocket standard would have on the Web, assuming we continue down the path that has already been laid out.
jonas_jacobi_bw_cropped_120

The impact could be the same, or even more profound, as when we were first introduced to HTTP as a means to share static documents. The difference is that this time the targeted market is already defined – it is called the Web. I have over the past several years, half jokingly and half seriously, compared the current static Web with a push to talk radio (aka Walkie Talkie) and the new living Web with a cell phone. You can get by with the WT and solve most of your problems; after all it’s been around for a while and it works. If you want to communicate with a friend in “real-time” you can solve it by getting two WTs, one to talk and one to listen. With a new Web standard, WebSocket, entering the market, Web developers now have access to the equivalent of a cellphone – one channel for “talk” and “listen”.

What would you choose if both push-to-talk and cell phone were  available to you? What would developers choose if both technologies were readily available to them (e.g.: browser support)?

Well, if you are uncertain and feel like WebSocket is an unproven standard you might want to relate to this; remember the first time your friends started pushing you to buy a cellphone although you already had a stationary phone at home and one at the office that worked perfectly? Now several years later we all have at least one cell phone, each, and we can’t (at least I can’t) live without it.

This is exactly the same impact the following line of code will have on the Web in comparison with the current HTTP communication we are so used and accustomed too.

var mySocket = new WebSocket("ws://websocket.org/");

If you do understand the profound impact this one line of code will have you are in good shape and most likely are already using, extending, or pushing this new standard solution from W3C and IETF. If you are not, then let me take a short moment to explain why it is so important:

  1. HTTP was designed to deliver static documents, not to deliver transactional, dynamic, and real-time data updates.
  2. HTTP is by design stateless, so session state needs to be artificially maintained. Traditionally this is done by a legacy Web-tier solution such as an application server like Oracle WebLogic Server or IBM WebSpere.
  3. In every environment developers have access to a “socket” interface, which enables them to communicate using any format (read protocol) over a full-duplex connection. Not on the Web.
  4. Not having access to a standard, Web-friendly, socket API forces us to create transformation layers when sending data from a Web client, using HTTP, to a backend system relying on a different full-duplex TCP protocol e.g. XMPP, STOMP, AMQP.
  5. The above line of code opens the floodgates to use any TCP-based communication format, which in turn enables developers to freely innovate and create new types of Web applications that previously have not been feasible over the existing HTTP infrastructure.
  6. WebSocket offers a far better use of bandwidth by getting rid of unnecessary HTTP headers when information is shared. The improvement is at a ratio of up to 1000x.
  7. The latency to deliver data is greatly improved by eliminating the round trip of the HTTP request-response model, and by using the bandwidth more efficiently.

With the explosive growth of Web-enabled devices (yes, I’m thinking about the iPhone, iPad, Android, Galaxy, etc…) and the demand for more and live information, communication and distribution of data over the Web is growing exponentially. At this rate the growth of data distributed over the Web will out pace the performance principals of Moore’s Law, which we depend on to ensure that our hardware can keep up with our needs.

WebSocket traffic vs. HTTP traffic

For individuals this may not be too much of a concern, but for companies providing online services it will be, and already is, a huge and costly issue since it requires a tremendous amount of resources to deliver on the increasing demand for live information over the Web (read about Google’s move  and Facebook’s move).

For example, when a user enters a single character ‘a’ in a search engine, a drop down list appears automatically showing possible search results starting with letter ‘a’. Behind the scenes an HTTP request has been issued asking the server for the information displayed in the drop down list. For every new character entered a new HTTP request is issued to the server to request for more information. The same HTTP characteristics you can find in collaborative online documents such as Google Docs, where each character entered generates a POST to ensure that users editing or looking at the same document can see each other changes in real-time.

Now, what was sent, what was received, and what was really needed?

There is a great article on websocket.org, called a “Quantum Leap in Scalability for the Web” that is outlining the difference between HTTP and WebSocket in terms of bandwidth utilization. In this article the sample application is a simple trading solution, but the math can be applied to any HTTP-based dynamic and transactional Web application.

In the article we have 0,665Gbps in header traffic to respond to 100,000 users per request.

What is the impact of using WebSocket technology? There are no sizable headers involved passing information between a client and a Websocket Gateway. Let’s apply the above math example to WebSocket technology as described by the article:

100,000 visitors receiving an update every second.  (WS wireframe = 2 byte) * 100,000 * 8 = 1,600,000 bps (0.001526Gbps).

Results from this easy math:

HTTP:// = 0,665Gbps versus WS:// = 0.001526Gbps.  In the above sample Websocket communication is 436 times more efficient. 436 times! We are talking about a gigantic leap of improvement, and that assuming that your cookies are not adding more data than this sample.

WebSocket is not a better Ajax!

Not only is the new standard improving bandwidth utilization it also gives us the ability to use any TCP-based high level communication format for our Web applications. This part of the HTML5 WebSocket standard has still yet to be fully appreciated. Right now most solutions and developers tinkering with the WebSocket APIs are looking at the new standard as merely a better replacement of XHR, or Ajax, when in fact it is a quantum leap forward in communicating over the Web that cannot be compared to XHR. With WebSocket we can now build client libraries in any Web technology supporting any TCP-based protocols. A simple example would be to extend the now widely used chat protocol XMPP to the Web (here is a demo site that lets you log in to Google Talk using XMPP over WebSocket) by providing a client-side implementation on top of Websocket APIs, or an advanced example would be to extend Java Message Service (JMS) over WebSocket such as the Kaazing WebSocket Gateway.

Scaling a WebSocket Solution

Web developers have been trying to work around the limitations of HTTP since the early days using techniques such as Comet, Reverse Ajax, or HTTP Streaming. With a move to persistent connections, or a stateful Web, server scalability of concurrent connections has been, and still is, a serious concern. Holding on to a thread on the server while the thread is not in use, combined with an Web-tier and infrastructure that was not designed for this, is not necessarily a scalable combination. Now, great strides have been made to ensure better scalability across technology stacks such as the use of NIO in Java.

At Kaazing we have always taken scalability and performance extremely serious and focused on making sure that our software is not in the way of scale or performance. As a matter of fact, we did a benchmark over the new year 2008/2009, to prove that scaling a WebSocket solution with persistent connections was not an issue, so we brought in a Java performance expert – Kirk Pepperdine – to help us and by the first weeks of Jan 09 we were running 1,000,000 concurrent connections on one single server. Now, is this practical? A more realistic scenario is running 1,000,000 users on a single rack or half a rack. This would enable us to have failover and high-availability, while still providing great performance and scale. So, last year we ran new tests together with DELL and Tibco to ensure not only great scale but also outstanding performance: DELL, TIBCO, and Kaazing enable ‘The Fastest Million’ to revolutionize real-time data delivery over the Web.

In Conclusion

The simplest design ideas are often the innovations with the most impact. WebSocket as an idea and design is extremely “simple” and its impact on our industry will be profound. Of course, with simple ideas you also get the “doubters”. I remember one time when my co-founder John Fallows and I met with a renowned VC in Silicon Valley and he asked us:

“If this is such a great idea why has no one come up with this idea before?”

I guess you could ask humanity a similar question about why it took several thousands of years to invent the wheel – after all it’s so obvious and simple.

What is important to understand is that we now have at our disposal a very powerful tool that will enable us to communicate securely with anything over the Web, and that it is only our own imagination that will limit our ability to fully exploit the WebSocket standard to its full potential.

If you are having performance and scalability issues with your current Web solution then it is time to look at an enterprise WebSocket platform, such as the one Kaazing provides. To round off I’m just going to ask you one short question:

If you had a choice between building a Web application using HTTP and Websocket, and both were readily available to you, which one would you choose?

Posted in html5, Kaazing, WebSocket | 2 Comments

Kaazing Powering Real-Time Mobile Social Apps

For the 2012 Novela Festival of shared knowledge, held in Toulouse, France, Emmanuelle Mason, a local artist, whose practice explores and questions mixed mediums such as drawing, video, device, performance, photography, sculpture, digital and dance, partnered with software services companies Ekito and Kaazing to generate a huge immersive drawing experience where the public could map their movements and journeys live, onto a collective picture using their mobile phones.

deambulation

Kaazing’s partner built an exciting app for the Novela festival and conference. The aim of the project was to demonstrate the combination of art and technology to provide a completely unique experience for the participants of the Novela festival. To do this, Emmanuelle’s vision was to enable a drawing to emerge and exist without her direct intervention so that it became a collective production by the public acting as the participants.

To learn more about the project, read the whitepaper, titled Powering Real-Time Mobile Social Apps with Kaazing.

socialart

Posted in Uncategorized | Leave a comment