Bővebb ismertető
Foreword
The browser is, hands down, die most popular and ubiquitous deployment platform available to us today: virmally every computer, smartphone, tablet, and just about every other form factor imaginable can now execute JavaScript, render a web page, and of course, talk HTTP. This, on its own, is a remarkable achievement, especially when you realize that it only took us a litde over a decade to get to this stage. However, this is also just the beginning. The browser of yesterday looks nothing hke what we now have access to thanks to all ofthe innovations of HTML5.
It is hard to overstate the importance of what HTML5 WebSocket enables: up until now, the browser could only speak one language (HTTP), and that language was not designed for the requirements of the modern, real-time Web. Yes, we've made progress with interim solutions such as long-polling and Flash sockets, but the complexity and cost of these solutions has always hmited the capabilities of what we could do. WebSockets changes all of that: it is designed from the ground up to be data agnostic (binary and text), full-duplex, and optimized for minimum overhead, both in bytes and in latency.
WebSockets is TCP for the web-browser, except with a more robust and much easier to use API. Suddenly, our chent is able to implement any network protocol directly in the browser, which opens up an entire new world of possibilities. An XMPP chat client? Easy. Need to connect your client to a custom binary protocol deployed on your existing network? No problem! Even better, you can script, style, and deploy these clients directiy in the browser with all the web authoring tools you already know, love, and use.
The browser of yesterday talked to an HTTP server. With WebSockets, the browser can talk to anyone and implement any protocol: complete the HTTP handshake, upgrade the connection, and you are off to the races. We are no longer talking about building slightiy better or more interactive pages. With WebSockets we can build entirely new types of apps and experiences that can be delivered to your users today, directiy in their browser.
This book provides a great from-the-ground-up discussion of what WebSockets are, what problems they are helping us to solve, as well as a number of practical examples that will get you up and running in no time. You will be pleasantiy surprised how easy it is to work with WebSocket and how much you can accomplish with very httle code. Working with WebSockets is a blast, and this book by Vanessa, Frank, and Peter is a fitting guide. Enjoy!
Ilya Grigorik
Developer Advocate - Make the Web Fast, Google