HTML5 WebSocket权威指南

For your convenience Apress has placed some of the front matter material after the index. Please use the Bookmarks and Contents at a Glance links to access them. Download from Wow! eBook v Contents at a Glance Foreword ���������������������������������������������������������������������������������������� xiii About the Authors ���������������������������������������������������������������������������� xv About the Technical Reviewer ������������������������������������������������������� xvii Acknowledgments �������������������������������������������������������������������������� xix Chapter 1: Introduction to HTML5 WebSocket■■ �������������������������������� 1 Chapter 2: The WebSocket API■■ ����������������������������������������������������� 13 Chapter 3: The WebSocket Protocol■■ ��������������������������������������������� 33 Chapter 4: Building Instant Messaging and Chat ■■ over WebSocket with XMPP ��������������������������������������������������������� 61 Chapter 5: Using Messaging over WebSocket with STOMP■■ ���������� 85 Chapter 6: VNC with the Remote Framebuffer Protocol■■ ������������� 109 Chapter 7: WebSocket Security■■ �������������������������������������������������� 129 Chapter 8: Deployment Considerations■■ �������������������������������������� 149 Appendix A: Inspecting WebSocket Traffic■■ ��������������������������������� 163 Appendix B: WebSocket Resources■■ �������������������������������������������� 177 Index ���������������������������������������������������������������������������������������������� 183 1 Chapter 1 Introduction to HTML5 WebSocket This book is for anyone who wants to learn how to build real-time web applications. You might say to yourself, “I already do that!” or ask “What does that really mean?” Let’s clarify: this book will show you how to build truly real-time web applications using a revolutionary new and widely supported open industry standard technology called WebSocket, which enables full-duplex, bidirectional communication between your client application and remote servers over the Web—without plugins! Still confused? So were we a few years ago, before we started working with HTML5 WebSocket. In this guide, we’ll explain what you need to know about WebSocket, and why you should be thinking about using WebSocket today. We will show you how to implement a WebSocket client in your web application, create your own WebSocket server, use WebSocket with higher-level protocols like XMPP and STOMP, secure traffic between your client and server, and deploy your WebSocket-based applications. Finally, we will explain why you should be thinking about using WebSocket right now. What is HTML5? First, let’s examine the “HTML5” part of “HTML5 WebSocket.” If you’re already an expert with HTML5, having read, say, Pro HTML5 Programming, and are already developing wonderfully modern and responsive web applications, then feel free to skip this section and read on. But, if you’re new to HTML5, here’s a quick introduction. HTML was originally designed for static, text-based document sharing on the Internet. Over time, as web users and designers wanted more interactivity in their HTML documents, they began enhancing these documents, by adding form functionality and early “portal” type capabilities. Now, these static document collections, or web sites, are more like web applications, based on the principles of rich client/server desktop applications. These web applications are being used on almost any device: laptops, smart phones, tablets—the gamut. HTML5 is designed to make the development of these rich web applications easier, more natural, and more logical, where developers can design and build once, and deploy anywhere. HTML5 makes web applications more usable, as well, as it removes the need for plugins. With HTML5, you now use semantic markup language like
instead of
. Multimedia is also much easier to code, by using tags like CHAPTER 1 ■ Introduction to HTML5 WebSocket 2 Figure 1-1.  HTML5 feature areas (W3C, 2011)




需要 8 金币 [ 分享pdf获得金币 ] 10 人已下载





下载需要 8 金币 [金币充值 ]
亲,您也可以通过 分享原创pdf 来获得金币奖励!