Setting up Discourse self-install with Cloudflare

Hello - we use Discourse conversation software for our site which is behind Cloudflare.

We are having an issue setting up Discourse properly behind Cloudflare. I’ve asked the Discourse community and they are responding that we need to set up “long polling” correctly as Cloudflare blocks long polling requests.

Is anyone familiar long polling and if Cloudflare does block long polling? And if so, is there a way to allowlist or page rule for long polling instead of setting up another server just for this outside of our environment?

Note: our main site and are allowlisted in Cloudflare’s firewall already.

Thanks in advance

In searching for answers, one term popped up: WebSockets. Do you have this feature turned on under Cloudflare’s Network tab? It seems like it’s the type of thing that will hold a connection open.

As for the whitelisting, I think that’s only for visitor IPs and Domains.

Thanks for the response. Yes, WebSockets are enabled, but as I understand, a websocket is not the same thing as long polling.

The only other reference that seemed helpful was:

As a fresh user, I don’t seem to have rights to start a new topic yet – this is the closest I could find.

Paging @staff with a critical bug report. Some time during last week, about 4 days ago, the long polling has stopped working on my Cloudflare enabled Discourse instances (for example, after being functional for years. This issue is easily reproduced by editing a post and observing the delay for the changes to appear on the edited post – they are not instant anymore, but appear only up to 30 seconds later, after the Discourse polling event.

This issue also impacts other events such as post flagging, user votes etc. More discussion at Discourse Meta.