{"id":1559,"date":"2020-06-07T22:06:36","date_gmt":"2020-06-07T14:06:36","guid":{"rendered":"https:\/\/www.wesbytes.com\/guide\/?post_type=kb&#038;p=1559"},"modified":"2026-06-04T09:33:11","modified_gmt":"2026-06-04T01:33:11","slug":"can-i-use-cloudflare-with-websockets","status":"publish","type":"kb","link":"https:\/\/www.servergigabit.com\/guide\/kb\/can-i-use-cloudflare-with-websockets","title":{"rendered":"Can I use Cloudflare with WebSockets?"},"content":{"rendered":"<h3><strong><\/strong><\/h3>\n<h3><strong>Can I use Cloudflare with WebSockets?<\/strong><\/h3>\n<p><em>WebSockets are available for all Cloudflare customers, with concurrent connections allocated by plan.\u00a0<\/em><\/p>\n<p>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 use for real-time applications such as live chat and gaming.<\/p>\n<p>Learn more about\u00a0WebSockets\u00a0and the most common uses of the protocol.<\/p>\n<hr \/>\n<div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\">\n<h6 class=\"mkb-anchor__title\">What plan do I need for WebSockets support on my site?<\/h6>\n<\/div>\n<table>\n<tbody>\n<tr>\n<td><strong>Cloudflare plan<\/strong><\/td>\n<td><strong>Volume of<br \/>\nconcurrent connections<\/strong><\/td>\n<td><strong>Example use case<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Free<\/td>\n<td>Low<\/td>\n<td>Hobby or demonstration site<\/td>\n<\/tr>\n<tr>\n<td>Pro<\/td>\n<td>Medium<\/td>\n<td>Project or small business<\/td>\n<\/tr>\n<tr>\n<td>Business<\/td>\n<td>High<\/td>\n<td>Important to your operations<\/td>\n<\/tr>\n<tr>\n<td>Enterprise<\/td>\n<td>Custom<\/td>\n<td>Mission critical and significant volume<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\">\n<h6 class=\"mkb-anchor__title\">How can I use WebSockets with Cloudflare?<\/h6>\n<\/div>\n<p>No additional configuration is required to send WebSockets traffic through Cloudflare. Cloudflare will immediately begin proxying your WebSockets through to your origin.<\/p>\n<hr \/>\n<div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\">\n<h6 class=\"mkb-anchor__title\">Why are these volume limits not specific numbers?<\/h6>\n<\/div>\n<p>Cloudflare powers several high-volume, mission critical WebSockets applications for Enterprise customers.<\/p>\n<p>Since introducing WebSockets support in 2014, Cloudflare has nearly triple its network map, going from 28 locations to over 150 (as mid-2018). In all locations, we\u2019ve add compute resources and multiple Tier 1 bandwidth providers.<\/p>\n<p>We\u2019re confident in our ability to offer WebSockets to all our customers now, but we\u2019re also thoughtful about allocating resources \u2013 including WebSockets connections \u2013 by plan level. So, we\u2019re starting with guidelines, and we\u2019ll learn from our customers\u2019 adoption.<\/p>\n<p>We enable modern technologies which make the Internet better. The best way to do that is let customers play, grow, and thrive.<\/p>\n<hr \/>\n<div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\">\n<h6 class=\"mkb-anchor__title\">Can I use WebSockets over SSL?<\/h6>\n<\/div>\n<p>Yes, Cloudflare SSL fully supports WebSockets traffic passing through our network.<\/p>\n<hr \/>\n<div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\">\n<h6 class=\"mkb-anchor__title\">Do Cloudflare Workers support proxying WebSockets?<\/h6>\n<\/div>\n<p>Yes, Cloudflare Workers support proxying WebSockets. However, it currently does not support:<\/p>\n<ul>\n<li>Acting as an endpoint (client or server) for a WebSocket session<\/li>\n<li>Manipulating or modifying individual messages<\/li>\n<\/ul>\n<hr \/>\n<div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\">\n<h6 class=\"mkb-anchor__title\">Does the Cloudflare Web Application Firewall (WAF) work with WebSockets?<\/h6>\n<\/div>\n<p>The initial HTTP 101 request is subject to the WAF, rate limiting, and other firewall features just like any any other WebSockets connection. However, once a connections have been establish the WAF does not perform any further inspections.<\/p>\n<hr \/>\n<div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\">\n<h6 class=\"mkb-anchor__title\">What happens if my site exceeds the number of concurrent WebSockets connections that Cloudflare expects?<\/h6>\n<\/div>\n<p>Immediately, nothing. Within reason, Cloudflare will allow occasional spikes in usage beyond our guidelines, and we will not apply unnecessary limits.<\/p>\n<p>Repeated spikes or high continued usage will prompt a dialogue: we\u2019ll reach out to learn more about your application. Barring abuse or attack, we will not impose limits errors for any application without contacting the customer.<\/p>\n<p>Customers whose usage claims a disproportionate percentage of resources for their current plan level may be asked to upgrade to the plan level that matches their needs.<\/p>\n<hr \/>\n<div class=\"mkb-anchor mkb-clearfix mkb-back-to-top-inline\">\n<h6 class=\"mkb-anchor__title\">Technical note<\/h6>\n<\/div>\n<p>When Cloudflare releases new code to its global network, we may restart servers, which terminates WebSockets connections.<\/p>\n<p>&nbsp;<\/p>\n<p>Please refer to the following article to know more.<br \/>\nKnowledge Base: <a href=\"https:\/\/www.servergigabit.com\/guide\/kb\/how-does-cloudflare-work\">How does Cloudflare work?\u00a0<\/a><br \/>\n.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Can I use Cloudflare with WebSockets? WebSockets are available for all Cloudflare customers, with concurrent connections allocated by plan.\u00a0 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.&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"kbtopic":[43],"kbtag":[1124,1430],"class_list":["post-1559","kb","type-kb","status-publish","hentry","kbtopic-cloudflare","kbtag-cloudflare","kbtag-websockets"],"_links":{"self":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/1559","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/comments?post=1559"}],"version-history":[{"count":6,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/1559\/revisions"}],"predecessor-version":[{"id":6683,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/1559\/revisions\/6683"}],"wp:attachment":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/media?parent=1559"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=1559"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtag?post=1559"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}