# Mosquitto mqtt connection via Cloudflare using websockets

**URL:** https://discourse.nodered.org/t/mosquitto-mqtt-connection-via-cloudflare-using-websockets/99234
**Category:** General
**Created:** [2 October 2025 08:26 UTC](https://discourse.nodered.org/t/mosquitto-mqtt-connection-via-cloudflare-using-websockets/99234 "2025-10-02T08:26:34Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![grilli303](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/grilli303/32/103634_2.png) [@grilli303](https://discourse.nodered.org/u/grilli303)
#### Post date: [2 October 2025 08:26 UTC](https://discourse.nodered.org/t/mosquitto-mqtt-connection-via-cloudflare-using-websockets/99234/1 "2025-10-02T08:26:34Z")

</div>

I have a current question on a similar topic, that has already been discussed here.  
I would like to set up a Mosquitto mqtt connection via Cloudflare using websockets  
In my case, I adjusted my configuration for access via websockets accordingly.  
Now I can establish an mqtt connection via websockets in my internal network (Port: 8883), but I have not been able to do so via Cloudflare tunnel with websockets so far. Before I go into the details about my configuration, I would like to throw the question into the round whether an MQTT connection via Cloudflare and websockets is even possible according to your experience.  
I am referring to the free Cloudfare pricing plan in my question. If it makes more sense to create a new topic for my question, please let me know. Now I'm looking forward to your answers.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [2 October 2025 09:07 UTC](https://discourse.nodered.org/t/mosquitto-mqtt-connection-via-cloudflare-using-websockets/99234/2 "2025-10-02T09:07:14Z")

</div>

Have you done a search on the forum? There are a number of threads that might help you out

---

<div class="post-metadata">

### Author: ![grilli303](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/grilli303/32/103634_2.png) [@grilli303](https://discourse.nodered.org/u/grilli303)
#### Post date: [2 October 2025 09:21 UTC](https://discourse.nodered.org/t/mosquitto-mqtt-connection-via-cloudflare-using-websockets/99234/3 "2025-10-02T09:21:04Z")

</div>

Yes, of course I searched first. A similar topic that I could find is from 2018 do not answer my question.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [2 October 2025 10:06 UTC](https://discourse.nodered.org/t/mosquitto-mqtt-connection-via-cloudflare-using-websockets/99234/4 "2025-10-02T10:06:00Z")

</div>

Not really wanting to be "that guy" but since I dont use cloudflare I cannot help directly but I did run a question through ChatGPT and it _seemed_ to give a reasonably coherent answer to the question (proof will of course be in the pudding!)

The question I posed was:

> What steps would I need to take to permit Cloudflare tunnel to allow external connectivity to my internally hosted Mosquitto MQTT broker on websockets (ws 8883)

Give it ago.

Would be great if you get it working and feedback your solution for others to use.

---

<div class="post-metadata">

### Author: ![grilli303](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/grilli303/32/103634_2.png) [@grilli303](https://discourse.nodered.org/u/grilli303)
#### Post date: [2 October 2025 18:27 UTC](https://discourse.nodered.org/t/mosquitto-mqtt-connection-via-cloudflare-using-websockets/99234/5 "2025-10-02T18:27:32Z")

</div>

Hi Steve, that's a good idea. I will check it out. Greetings Daniel.

---

<div class="post-metadata">

### Author: ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)
#### Post date: [3 October 2025 05:39 UTC](https://discourse.nodered.org/t/mosquitto-mqtt-connection-via-cloudflare-using-websockets/99234/6 "2025-10-03T05:39:28Z")

</div>

> [@Steve-Mcl](#):
>
> What steps would I need to take to permit Cloudflare tunnel to allow external connectivity to my internally hosted Mosquitto MQTT broker on websockets (ws 8883)

Nice hint, seems it is even possible for Google to give you the answer

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/a/7a8f4aaf28f55d15b41e6711498f9b98e1d4fa66.png)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [1 January 2026 05:40 UTC](https://discourse.nodered.org/t/mosquitto-mqtt-connection-via-cloudflare-using-websockets/99234/7 "2026-01-01T05:40:24Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
