CHAPTER 2

image

The WebSocket API

This chapter introduces you to the WebSocket Application Programming Interface (API), which you can use to control the WebSocket Protocol and create WebSocket applications. In this chapter, we examine the building blocks of the WebSocket API, including its events, methods, and attributes. To learn how to use the API, we write a simple client application, connect to an existing, publicly available server (http://websocket.org), which allows us to send and receive messages over WebSocket. By using an existing server, we can focus on learning about the easy-to-use API that enables you to create WebSocket applications. ...

Get The Definitive Guide to HTML5 WebSocket now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.