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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Rights 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
DOI: https://doi.org/10.1007/978-1-4302-4741-8_2
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4302-4740-1
Online ISBN: 978-1-4302-4741-8
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books