Subscribe to receive notifications of new posts:

Everybody gets WebSockets

05/05/2016

2 min read

Two summers ago, with a seemed-big-at-the-time network of 28 datacenters, not long after introducing Medellin, CloudFlare introduced support for WebSockets, initially for our Enterprise customers.

CC BY 2.0 image by Marcin Wichary

Today, with our network nearing 80 global locations, we're pleased to announce support for WebSockets for all our customers, including Enterprise, Business, Pro, and Free, with resources allocated by plan level.

What are WebSockets?

If you don't want to read RFC 6455, then this short paragraph from our previous blog post explains:

The WebSocket protocol is a distinct TCP-based protocol, however, it’s initiated by an HTTP request which is then "upgraded" to create a persistent connection between the browser and the server. A WebSocket connection is bidirectional: the server can send data to the browser without the browser having to explicitly ask for it. This makes things like multiplayer games, chat, and other services that require real-time exchange of information possible over a standard web protocol

There's a lot more technical history in that post covering how we modified NGINX to support a huge number of connections through port reuse. But the bottom line is that WebSockets are a vital technology for web sites that need to get real-time updates for features like social feeds, multimedia chat, collaborative editing, multi-player gaming, stock updates, and more.

Performance & Latency

Because the WebSocket protocol creates a single connection and doesn’t require HTTP requests, WebSockets can provide anywhere from 500:1 to a 1000:1 reduction in unnecessary HTTP header traffic, compared to HTTP polling solutions.

The server no longer needs to wait for a request to come back before it sends new data; it can simply push the data to the client the moment it has new information. Tests have shown a 3:1 reduction in latency compared to other polling solutions.

   

Modern Internet, for More People

Last week, we expanded our deep support for HTTP/2 to include Server Push. HTTP/2 was finalized as a spec in 2015, so almost a newborn child as technologies go. (We're excited to help HTTP/2 grow up fast.)

By comparison, WebSockets is already a toddler, as RFC 6455 was finalized in 2011.

But, perhaps because of complexity or expense, WebSockets hasn't seen as wide adoption as we'd expect. CloudFlare is removing those obstacles, and frankly we're curious to see what happens.

We are building a better Internet, and while that may sound like a platitude... making modern tech easy to use matters. We're eager to see what our customers do to play, grow, and thrive with another tool available.

Read more about WebSockets generally, or review details in our support article.

We protect entire corporate networks, help customers build Internet-scale applications efficiently, accelerate any website or Internet application, ward off DDoS attacks, keep hackers at bay, and can help you on your journey to Zero Trust.

Visit 1.1.1.1 from any device to get started with our free app that makes your Internet faster and safer.

To learn more about our mission to help build a better Internet, start here. If you're looking for a new career direction, check out our open positions.
Speed & ReliabilityProduct News

Follow on X

John Roberts|@pencoyd
Cloudflare|@cloudflare

Related posts

March 08, 2024 2:05 PM

Log Explorer: monitor security events without third-party storage

With the combined power of Security Analytics + Log Explorer, security teams can analyze, investigate, and monitor for security attacks natively within Cloudflare, reducing time to resolution and overall cost of ownership for customers by eliminating the need to forward logs to third-party SIEMs...