O'Reilly logo

Pro HTML5 Programming: Powerful APIs for Richer Internet Application Development by Frank Salim, Brian Albers, Peter Lubbers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Using the HTML5 WebSocket API

In this chapter, we'll explore what you can do with the most powerful communication feature in the HTML5 specification: HTML5 WebSockets, which defines a full-duplex communication channel that operates through a single socket over the web. Websocket is not just another incremental enhancement to conventional HTTP communications; it represents a large advance, especially for real-time, event-driven web applications.

HTML5 WebSockets provide such an improvement from the old, convoluted "hacks" that are used to simulate a full-duplex connection in a browser that it prompted Google's Ian Hickson—the HTML5 specification lead—to say:

"Reducing kilobytes of data to 2 bytes...and reducing latency from 150ms to 50ms ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required