Does your browser
support WebSocket?



The Definitive Guide to HTML5 WebSocket

Build Real-Time Applications with HTML5


By Vanessa Wang, Frank Salim, and Peter Moskovits

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.

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


Table of Contents

  1. Introduction to HTML5 WebSocket
  2. The WebSocket API
  3. The WebSocket Protocol
  4. Building Instant Messaging and Chat over WebSocket with XMPP
  5. Using Messaging Over WebSocket with STOMP
  6. VNC with the Remote Framebuffer Protocol
  7. WebSocket Security
  8. Deployment Considerations
Appendix A: Inspecting WebSocket Traffic
Appendix B: WebSocket Resources

Source Code and Preconfigured VM

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. Check out the following screencasts for a quick view into the VM environment and what the hands-on that the chapters cover. You can also dive right into the code yourself:

  1. View the Source Code on Github
  2. Download the VM

Chapter 2: The WebSocket API



Chapter 3: The WebSocket Protocol



Chapter 4: Building Instant Messaging and Chat over WebSocket with XMPP



Chapter 5: Using Messaging Over WebSocket with STOMP



Chapter 6: VNC with the Remote Framebuffer Protocol



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.

In the press