وبلاگ بلیان

WebSocket : lightweight client-server communications

معرفی کتاب «WebSocket : lightweight client-server communications» نوشتهٔ Andrew Lombardi، منتشرشده توسط نشر O'Reilly Media در سال 2015. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «WebSocket : lightweight client-server communications» در دستهٔ بدون دسته‌بندی قرار دارد.

Until recently, creating desktop-like applications in the browser meant using inefficient Ajax or Comet technologies to communicate with the server. With this practical guide, you’ll learn how to use WebSocket, a protocol that enables the client and server to communicate with each other on a single connection __simultaneously__. No more asynchronous communication or long polling! For developers with a good grasp of JavaScript (and perhaps Node.js), author Andrew Lombardi provides useful hands-on examples throughout the book to help you get up to speed with the WebSocket API. You’ll also learn how to use WebSocket with Transport Layer Security (TLS). * Learn how to use WebSocket API events, messages, attributes, and methods within your client application * Build bi-directional chat applications on the client and server with WebSocket as the communication layer * Create a subprotocol over WebSocket for STOMP 1.0, the Simple Text Oriented Messaging Protocol * Use options for older browsers that don’t natively support WebSocket * Protect your WebSocket application against various attack vectors with TLS and other tools * Debug applications by learning aspects of the WebSocket lifecycle Copyright 4 Table of Contents 5 Preface 11 Who Should Read This Book 11 Goals of This Book 12 Navigating This Book 12 Conventions Used in This Book 12 Using Code Examples 13 Safari庐 Books Online 13 How to Contact Us 14 Acknowledgments 14 Chapter 1. Quick Start 15 Getting Node and npm 16 Installing on Windows 16 Installing on OS X 16 Installing on Linux 16 Hello, World! Example 17 Why WebSocket? 21 Summary 22 Chapter 2. WebSocket API 23 Initializing 23 Stock Example UI 25 WebSocket Events 26 Event: Open 27 Event: Message 28 Event: Error 29 Event: PING/PONG 29 Event: Close 29 WebSocket Methods 30 Method: Send 30 Method: Close 31 WebSocket Attributes 32 Attribute: readyState 32 Attribute: bufferedAmount 33 Attribute: protocol 33 Stock Example Server 33 Testing for WebSocket Support 35 Summary 35 Chapter 3. Bidirectional Chat 37 Long Polling 37 Writing a Basic Chat Application 38 WebSocket Client 41 Client Identity 41 Events and Notifications 43 The Server 44 The Client 45 Summary 48 Chapter 4. STOMP over WebSocket 49 Implementing STOMP 50 Getting Connected 50 Connecting via the Server 53 Setting Up RabbitMQ 56 Connecting the Server to RabbitMQ 58 The Stock Price Daemon 61 Processing STOMP Requests 63 Client 64 Using RabbitMQ with Web-Stomp 70 STOMP Client for Web and Node.js 71 Installing the Web-Stomp Plug-in 71 Echo Client for Web-Stomp 71 Summary 73 Chapter 5. WebSocket Compatibility 75 SockJS 76 SockJS Chat Server 77 SockJS Chat Client 80 Socket.IO 80 Adobe Flash Socket 81 Connecting 81 Socket.IO Chat Server 82 Socket.IO Chat Client 83 Pusher.com 84 Channels 85 Events 86 Pusher Chat Server 87 Pusher Chat Client 90 Don鈥檛 Forget: Pusher Is a Commercial Solution 92 Reverse Proxy 92 Summary 92 Chapter 6. WebSocket Security 93 TLS and WebSocket 93 Generating a Self-Signed Certificate 93 Installing on Windows 94 Installing on OS X 94 Installing on Linux 94 Setting up WebSocket over TLS 94 WebSocket Server over TLS Example 96 Origin-Based Security Model 97 Clickjacking 99 X-Frame-Options for Framebusting 100 Denial of Service 101 Frame Masking 101 Validating Clients 102 Setting Up Dependencies and Inits 102 Listening for Web Requests 103 WebSocket Server 105 Summary 106 Chapter 7. Debugging and Tools 109 The Handshake 109 The Server 110 The Client 111 Download and Configure ZAP 113 WebSocket Secure to the Rescue 116 Validating the Handshake 116 Inspecting Frames 117 Masked Payloads 117 Closing Connection 122 Summary 123 Chapter 8. WebSocket Protocol 125 HTTP 0.9鈥擳he Web Is Born 125 HTTP 1.0 and 1.1 125 WebSocket Open Handshake 126 Sec-WebSocket-Key and Sec-WebSocket-Accept 127 WebSocket HTTP Headers 128 WebSocket Frame 130 Fin Bit 131 Frame Opcodes 131 Masking 132 Length 132 Fragmentation 133 WebSocket Close Handshake 133 WebSocket Subprotocols 135 WebSocket Extensions 136 Alternate Server Implementations 137 Summary 138 Index 139 About the Author 143 "Until recently, creating desktop-like applications in the browser meant using inefficient Ajax or Comet technologies to communicate with the server. With this practical guide, you'll learn how to use WebSocket, a protocol that enables the client and server to communicate with each other on a single connection simultaneously. No more asynchronous communication or long polling! For developers with a good grasp of JavaScript (and perhaps Node.js), author Andrew Lombardi provides useful hands-on examples throughout the book to help you get up to speed with the WebSocket API. You'll also learn how to use WebSocket with Transport Layer Security (TLS)"--Page 4 of cover
دانلود کتاب WebSocket : lightweight client-server communications