Aug 14, 2026 · WebSockets are open connections sustained between the client and the origin server. Inside a WebSockets connection, the client and the origin can pass data back and forth without having to reestablish sessions. This makes exchanging data within a WebSockets connection fast. WebSockets are often used for real-time applications such as live chat and gaming.
Aug 14, 2026 · ### Session affinity for load -balanced WebSocket origins If your WebSocket origin is behind a Cloudflare Load Balancer , turn on **Session affinity** to ensure all requests from the same client are routed to the same origin server. Without session affinity, a WebSocket reconnect may land on a different origin that does not have the session state.
Sep 2, 2024 · How to proxy WebSocket connections through Cloudflare CDN, build edge WebSocket handlers with Workers, and manage stateful connections with Durable Objects.
Jan 2, 2022 · Hello, Am I reading correctly “Using Cloudflare with WebSockets ”, that a single WebSocket initialisation counts as a single request in the load balancing pricing model and all the subsequent communication on that connection is “free” of charge, but has a soft limit on the number of simultaneous connections, according to the plan, which I choose(i.e. Free, Pro,…)?
Sep 2, 2024 · Nginx sits in front of most WebSocket deployments as a reverse proxy. This guide provides copy-paste configs for proxying, load balancing , SSL/TLS termination, and related operational concerns.
Jan 24, 2026 · A comprehensive guide to configuring load balancers for WebSocket applications, covering Nginx, HAProxy, AWS ALB, and sticky session strategies.
Dec 6, 2020 · Forgive my ignorance as my experience with load balancers and websockets are limited. I'm trying to understand how a client can connect to a cluster of servers that sits behind a load balancer through websockets . My understanding of load balancers is that they're like reverse proxies.
May 13, 2025 · It covers the configuration files, deployment processes, and setup requirements for running the template on Cloudflare Workers. For information about the WebSocket implementation itself, see WebSocket Implementation.
Jul 4, 2025 · For horizontal scaling, distribute WebSocket connections across multiple origin servers using Cloudflare 's load balancing features. Session affinity, also called sticky sessions, ensures that a given client's connection routes to the same origin server for the connection's lifetime.