> For the complete documentation index, see [llms.txt](https://docs.datacake.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.datacake.de/api/internal-mqtt/mqtt-over-websocket.md).

# MQTT over WebSocket

## Introduction

In some situations you may need to tunnel MQTT over WebSockets, the reasons for this are something like:

* Using MQTT in the browser
* Problems with the connection of a classic MQTT client

The Datacake MQTT Broker supports client connections via the WebSocket protocol. In this tutorial we will show you how to use this.

## Connection Details

* Server: `ws://mqtt.datacake.co`
* Port: `9001`

## Node-RED

If you encounter problems with the connection of an MQTT node in Node-RED, you can try to see if a WebSocket connection can solve the problem. In the following steps, we will show you how to prepare the MQTT node for connection via WebSockets.

### Broker Configuration

In the following screenshot you can see how the configuration of the MQTT node in Node-RED must look like. So change the according configuration as follows.

![](https://2221155863-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LNA8_b8wmabHgJ0QXoJ%2F-M_tdKmS21c8E7vbaEqf%2F-M_toBXt4z62lPXKgp_i%2FBildschirmfoto%202021-05-17%20um%2012.13.13.png?alt=media\&token=eadc1ac0-bb31-4ad6-9817-a9db6bca81a5)

{% hint style="info" %}
If you enter the `wss://` URL in the server address input field, the port input field is disabled. Therefore, specify the port number as a subsequent element in the server address, so:\
\
\&#xNAN;**`wss://mqtt.datacake.co:9001`**
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.datacake.de/api/internal-mqtt/mqtt-over-websocket.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
