https://ably.com/blog/introducing-the-websocket-handbook Your browser has Javascript disabled. Please enable it to use this site. Hide this warning * Platform Ably homepage The Ably Platform Easily power any realtime experience in your application. No complex infrastructure to manage or provision. Just a simple API that handles everything realtime, and lets you focus on your code. Explore how it works Our features + Publish/subscribe messaging Feature-rich pub/sub messaging to power any realtime requirement. + Push notifications Deliver native notifications at scale with our unified API. + Third-party integrations Integrate and extend Ably with cloud services like AWS Kinesis. + Multi-protocol messaging We support pub/sub over WebSockets, MQTT, SSE, and more. + Streaming data sources Augment your apps with realtime updates like weather or transit. Explore all platform features Our technology + Predictable performance We provide predictability so you can be confident your realtime application will always perform as expected. + Guaranteed ordering & delivery We guarantee in-order data delivery, even after disconnections. + Fault tolerant infrastructure Redundant at regional and global levels with 99.999% uptime SLAs. + High scalability & availability Elastic, battle-tested global infrastructure for massive scale. + Global edge network An edge network of 15 core routing datacenters and 200+ PoPs. Explore our technology * Use Cases By industry use case + EdTech Deliver interactive learning experiences like multi-user classrooms with chat. + Automotive, Logistics, & Mobility Power asset tracking, live transit updates, race-critical diagnostics, and more. + B2B Platforms Empower customers with realtime technology that gives them a competitive edge. + Healthcare Provide HIPAA-compliant realtime apps healthcare professionals can depend on. + Virtual Events Power engaging virtual events with interactive realtime features. + IoT & Connected Devices Monitor and control global IoT deployments of any kind in realtime. + Sports & Media Deliver global realtime experiences to keep fans informed, engaged, entertained. + Gaming Power interactive gaming experiences that are wicked fast and utterly reliable. + eCommerce & Retail Enable realtime pricing, inventory, and transactions to enrich user experiences. + Asset Tracking Track assets in realtime with a solution optimized for last mile logistics, food delivery applications, and urban mobility services. * Why Ably Why companies choose Ably + Customers + Case studies + Compare our tech + Ably & AWS + Resources Four pillars of dependability + Predictable performance A low-latency global edge network across 200+ PoPs. + Guaranteed ordering & delivery We guarantee in-order data delivery, even after disconnections. + Fault tolerant infrastructure Redundant at regional and global levels with 99.999% uptime SLAs. + High scalability & availability Elastic, battle-tested global infrastructure for massive scale. Explore our Four Pillars of Dependability Blog More from our Blog * Developers Documentation [ ] Docs, quick start guides, tutorials, and API reference to help you start building with Ably's platform and APIs. Visit Documentation Explore + Third-party integrations & plugins Integrate and extend Ably with cloud services like AWS Kinesis. + Multi-protocol messaging We support pub/sub over WebSockets, MQTT, SSE, and more. + Streaming data sources Augment your apps with realtime updates like weather or transit. Quick links + Download an SDK + Platform changelog + Support & FAQs + Status * Pricing * Contact us * Login * Sign up free * Login * + Platform Back ------------------------------------------------------------- Ably homepage The Ably Platform Easily power any realtime experience in your application. No complex infrastructure to manage or provision. Just a simple API that handles everything realtime, and lets you focus on your code. Explore how it works Our features o Publish/subscribe messaging Feature-rich pub/sub messaging to power any realtime requirement. o Push notifications Deliver native notifications at scale with our unified API. o Third-party integrations Integrate and extend Ably with cloud services like AWS Kinesis. o Multi-protocol messaging We support pub/sub over WebSockets, MQTT, SSE, and more. o Streaming data sources Augment your apps with realtime updates like weather or transit. Explore all platform features Our technology o Predictable performance We provide predictability so you can be confident your realtime application will always perform as expected. o Guaranteed ordering & delivery We guarantee in-order data delivery, even after disconnections. o Fault tolerant infrastructure Redundant at regional and global levels with 99.999% uptime SLAs. o High scalability & availability Elastic, battle-tested global infrastructure for massive scale. o Global edge network An edge network of 15 core routing datacenters and 200+ PoPs. Explore our technology + Use Cases Back ------------------------------------------------------------- By industry use case o EdTech Deliver interactive learning experiences like multi-user classrooms with chat. o Automotive, Logistics, & Mobility Power asset tracking, live transit updates, race-critical diagnostics, and more. o B2B Platforms Empower customers with realtime technology that gives them a competitive edge. o Healthcare Provide HIPAA-compliant realtime apps healthcare professionals can depend on. o Virtual Events Power engaging virtual events with interactive realtime features. o IoT & Connected Devices Monitor and control global IoT deployments of any kind in realtime. o Sports & Media Deliver global realtime experiences to keep fans informed, engaged, entertained. o Gaming Power interactive gaming experiences that are wicked fast and utterly reliable. o eCommerce & Retail Enable realtime pricing, inventory, and transactions to enrich user experiences. o Asset Tracking Track assets in realtime with a solution optimized for last mile logistics, food delivery applications, and urban mobility services. + Why Ably Back ------------------------------------------------------------- Why companies choose Ably o Customers o Case studies o Compare our tech o Ably & AWS o Resources Four pillars of dependability o Predictable performance A low-latency global edge network across 200+ PoPs. o Guaranteed ordering & delivery We guarantee in-order data delivery, even after disconnections. o Fault tolerant infrastructure Redundant at regional and global levels with 99.999% uptime SLAs. o High scalability & availability Elastic, battle-tested global infrastructure for massive scale. Explore our Four Pillars of Dependability Blog More from our Blog + Developers Back ------------------------------------------------------------- Documentation [ ] Docs, quick start guides, tutorials, and API reference to help you start building with Ably's platform and APIs. Visit Documentation Explore o Third-party integrations & plugins Integrate and extend Ably with cloud services like AWS Kinesis. o Multi-protocol messaging We support pub/sub over WebSockets, MQTT, SSE, and more. o Streaming data sources Augment your apps with realtime updates like weather or transit. Quick links o Download an SDK o Platform changelog o Support & FAQs o Status + Pricing ----------------------------------------------------------------- Contact us Sign up free * Blog: * Home * Ably News * Ably Engineering * Developers * Industry Trends * Hardest Aspects of Realtime Engineering Blog: Home Ably News Ably Engineering Developers Industry Trends Hardest Aspects of Realtime Engineering Developers The WebSocket Handbook: learn about the technology behind the realtime web [15801] By: Alex Diaconu Last updated: Jan 11, 2022 4 min read Standardized a decade ago through RFC 6455, WebSocket has since matured into one of the main technologies powering the modern web. Designed to be event-driven and full-duplex, and optimized for minimum overhead and low latency, WebSockets have become a preferred choice for many organizations and developers seeking to build interactive, realtime digital experiences that provide delightful user experiences. The WebSocket Handbook is a resource for developers who want to learn about the WebSocket technology and how to use it to build event-driven, realtime apps. The Handbook covers the core building blocks of the WebSocket technology, its characteristics, and advantages. It also provides a step-by-step walkthrough on how to build a realtime web app with WebSockets and Node.js. Discuss this post on HN [cs-ably-we]The WebSocket Handbook What are WebSockets? Before we dive into further details about the WebSocket Handbook, let's give a brief overview of WebSockets. In a nutshell, WebSocket is a web technology that enables bidirectional, full-duplex communication between client and server over a persistent, single-socket connection. The intent is to provide what is essentially an as-close-to-raw-as-possible TCP communication layer to web application developers. A WebSocket connection starts as an HTTP request/response handshake. If this initial handshake is successful, the client and server have agreed to use the existing TCP/IP connection that was established for the HTTP request as a WebSocket connection. This connection is kept alive for as long as needed (in theory, it can last forever), allowing the server and the client to independently send data at will in conceptual units referred to as messages. Once the WebSocket connection has served its purpose, it can be terminated via a closing handshake, which both the client and the server can initiate. High-level overview of a WebSocket connectionHigh-level overview of a WebSocket connection WebSockets mark a turning point for web development. Until the emergence of WebSockets, the realtime web was difficult to achieve and slower than we're used to nowadays; it was delivered by using techniques like AJAX and Comet (long) polling that were not truly optimized for realtime applications. The WebSocket technology has broad applicability. You can use it for different purposes, such as streaming data between backend services, or connecting a backend with a frontend via long-lasting, full-duplex connections. In short, WebSockets are an excellent choice for architecting event-driven systems and building realtime apps and services where it's essential for data to be delivered with immediacy, as soon as it becomes available. We can broadly group WebSocket use cases into two distinct categories: * Realtime updates, where the communication is unidirectional, and the server streams low-latency (and often frequent) updates to the client. Think of live sports updates, alerts, realtime dashboards, or location tracking, to name just a few use cases. * Bidirectional communication, where both the client and the server send and receive messages. Examples include chat, virtual events, and virtual classrooms (the last two usually involve features like polls, quizzes, and Q&As). WebSockets can also be used to underpin multi-user synchronized collaboration functionality, such as multiple people editing the same document simultaneously. Introducing the WebSocket Handbook The WebSocket Handbook consists of four chapters: * Chapter 1: The Road to WebSockets - looks at how web technologies evolved since the inception of the World Wide Web, culminating with the emergence of WebSockets, a vastly superior improvement on HTTP for building realtime web apps. * Chapter 2: The WebSocket Protocol - covers key considerations related to the WebSocket protocol. You'll find out how to establish a WebSocket connection and exchange messages, what kind of data can be sent over WebSockets, what types of extensions and subprotocols you can use to augment WebSocket * Chapter 3: The WebSocket API - provides details about the constituent components of the WebSocket API -- its events, methods, and properties, alongside usage examples for each of them. * Chapter 4: Building a Web App with WebSockets - provides detailed, step-by-step instructions on building a realtime web app with WebSockets and Node.js - an interactive cursor position-sharing demo. Download your copy below: The WebSocket Handbook Bear in mind that this is the first version of the WebSocket Handbook, and it does not intend to be exhaustive. In future versions, we plan to take the Handbook to the next level: * Add more details to the existing chapters. * Provide more examples and demo apps built with WebSockets. * Talk about engineering challenges such as reliably scaling WebSockets, handling reconnections with continuity, syncing state across multiple WebSocket servers, and ensuring superior messaging semantics and guarantees. We hope the Handbook will help you gain a good understanding of how WebSockets came to be and how they work, and make it easier for you to build realtime apps powered by WebSockets. We always treasure feedback from our readers. If you have questions, any suggestions for what we should include in future versions of the Handbook, or if you simply want to chat about WebSockets, contact us! If you are interested in quickly and easily building low-latency, scalable, fault-tolerant realtime functionality with WebSockets, sign up for a free account and see what Ably can do for you! Alex Diaconu Alex Diaconu Alex is a technical content writer. After years of documenting RESTful services, he is now exploring the world of realtime tech & writing about the many challenges of distributed event-driven systems. Read More of Developers Join the Data in Motion newsletter 1000s of industry pioneers trust Ably for monthly insights on the realtime data economy. [ ] Subscribe The Ably async/await post we promised The Ably async/await post we promised Learn how to write asynchronous Javascript and consume the promise-based version of Ably's JavaScript SDK using the async/await syntax. Dec 08, 2021 * 15 min read Ably at GopherCon UK Ably at GopherCon UK Ably was the delegate sponsor at GopherCon UK this year and we had a great time. Nov 18, 2021 * 3 min read Ably homepage The Ably Platform Easily power any realtime experience in your application via a simple API that handles everything realtime. * Pub/sub messaging * Push notifications * Third-party integrations * Multiple protocol messaging * Streaming data sources Ably is for * EdTech * Automotive, Logistics, & Mobility * B2B Platforms * Healthcare * Streaming data sources * eCommerce & Retail * Sports & Media * Gaming * IoT & Connected Devices Developers * Start in 5 minutes * Documentation * Tutorials * Changelog * Support & FAQs * SDKs * System status WHY ABLY * Customers * Case Studies * Four Pillars of Dependability * Compare our tech * Multi protocol support * Third-party integrations ABOUT * About Ably * Pricing * Blog * Careers * Open protocol policy * Press & Media * Contact us --------------------------------------------------------------------- Cookies Legals Data Protection Privacy We're hiring! Learn more at Glassdoor Rocket List 2021 Flexible Companies 2021 Close Dialog Sign up for a FREE account You can upgrade at any time. * 3m Messages per month * 100 Peak Connections * 100 Peak Channels * No Credit Card Required * Name[ ] Company name[ ] Email[ ] Password[ ] [ ] I agree and consent to: * the collection & use of my data as set out in the Privacy Policy * the Terms of Service (including mandatory binding arbitration of disputes) * the use of cookies * emails sent to you for account management purposes * marketing and promotional emails (of which you may opt-out) [Get your free account] Alternatively: Sign up with Google Sign up with Twitter Sign up with Github Close Dialog Login Email[ ] Password[ ] I forgot my password [Login] [ ] Keep me logged in for 2 weeks Login with SSO Don't have an account? Get started for free. * 3m Messages per month * 100 Peak Connections * 100 Peak Channels * No Credit Card Required Create your free account Alternatively log in with: Google Twitter Github Close Dialog Yes No