Skip to main content

Abstract

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. We also explain step-by-step how to use the WebSocket API to power HTML5 media using binary data. Finally, we discuss browser support and connectivity.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 49.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 64.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Vanessa Wang, Frank Salim, Peter Moskovits

About this chapter

Cite this chapter

Wang, V., Salim, F., Moskovits, P. (2013). The WebSocket API. In: The Definitive Guide to HTML5 WebSocket. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-4741-8_2

Download citation

Publish with us

Policies and ethics