Book Image

Getting Started with HTML5 WebSocket Programming

By : Vangos Pterneas
Book Image

Getting Started with HTML5 WebSocket Programming

By: Vangos Pterneas

Overview of this book

<p>WebSockets are capable of bi-directional, full-duplex communication over a persistent TCP connection They provide many benefits compared to the alternatives (for example, long-polling or Comet), such as lower overhead, persistent connections, and low latency. In short, it is the most technically challenging HTML5 feature to implement, but for truly interactive websites, it's a technology worth learning.</p> <p>Getting Started with HTML5 WebSocket Programming gives you the true power of bi-directional communication, implemented by using the brand new HTML5 WebSocket API. You’ll learn how to configure the server and clients, how to transmit different types of data and how to secure the whole system.</p> <p>This book will introduce you to the WebSocket world. We start by introducing the WebSocket API, and continue with practical, real-world examples until we can determine how to build multi-functional web apps for any type of device.</p> <p>You will learn how to configure a web client and a web server that will help you send messages to others using easy-to-use mechanisms. We will also find out how different data types, such as images and videos, can be transferred with little effort. We present additional fallback techniques and solutions for older browsers too. Finally, we will secure our clients from malicious attacks and other threats.</p>
Table of Contents (15 chapters)

What are we going to make?


Throughout this book, we are going to implement a real-world project: a simple, multi-user, WebSocket-based, chatting application. Live chat is a very common feature among all modern social networks. We will learn, step-by-step, how to configure the web server, implement the HTML5 client, and transfer messages between them.

Apart from plain text messages, we'll see how WebSockets handle various types of data, such as binary files, images, and videos. Yeah, we'll demonstrate real-time media streaming, too!

Moreover, we are going to enhance the security of our app, examine some known security risks and find out how to avoid common pitfalls. Furthermore, we'll take a glance at some fallback techniques targeting those poor guys who cannot (or do not want to) update their browsers yet.

Last but not least, we'll get mobile. You chat using a desktop browser, a phone, or a tablet. Wouldn't it be nice if you could use the same techniques and principles across multiple targets? Well, through reading this book, you'll find out how to easily convert your web app into a native mobile and tablet application as well.