O'Reilly logo

Getting Started with HTML5 WebSocket Programming by Vangos Pterneas

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

API overview

API, which stands for Application Programming Interface, is a set of objects, methods, and routines that let you interact with the underlying layer of functionality. Considering the WebSocket protocol, its API includes the WebSocket primary object, events, methods, and attributes.

Translating these characteristics into actions, the WebSocket API allows you to connect to a local or remote server, listen for messages, send data, and close the connection.

Here is a typical usage of the WebSocket API.

The following illustration shows the typical WebSocket workflow:

API overview

Browser support

The WebSocket protocol is a new HTML5 feature, so not every ...

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