Sign inSign up

eurotech/mqtt-ws-proxy

By eurotech

•Updated 9 months ago

mqtt-ws-proxy allows WebSockets MQTT clients to connect to native MQTT servers.

Image
0

10K+

eurotech/mqtt-ws-proxy repository overview

⁠What is mqtt-ws-proxy?

mqtt-ws-proxy is a lightweight proxy written in C++ that allows WebSockets MQTT clients to connect to native MQTT servers that don't expose WebSocket endpoints.

⁠How to use this image

Starting the container with the default configuration is simple:

docker run -p 8080:8080 --name mqtt-ws-proxy eurotech/mqtt-ws-proxy:tagname

The proxy will listen on port 8080 for plain WS connections and forward the traffic to a MQTT broker listening on the same loopback interface of the container. This can be enough when used as sidecar container in a Kubernates Pod.

It's possible to override the default configuration for more complex use cases mounting a new configuration file.

docker run -p 8080:8080 -p 8443:8443 -v ${PWD}/conf:/etc/mqtt-ws-proxy --name mqtt-ws-proxy eurotech/mqtt-ws-proxy:tagname mqtt-ws-proxy /etc/mqtt-ws-proxy/proxy.conf

The structure of a configuration file is the following:

{
    "mqtt": {
        "address": "127.0.0.1",
        "port": 1883
    },
    "ws": {
        "address": "0.0.0.0",
        "port": 8080
    },
    "wss": {
        "address": "0.0.0.0",
        "port": 8443,
        "crt_file": "/etc/mqtt-ws-proxy/cert.pem",
        "key_file": "/etc/mqtt-ws-proxy/key.pem"
    },
    "threads": 1
}

The mqtt section contains the address and port of the MQTT broker. For now only plain MQTT is supported. To disable an endpoint simply omit the ws or wss section. For WSS a certificate and a key file should be mounted as well.

Tag summary

Content type

Image

Digest

sha256:c4a6950ca…

Size

87.4 MB

Last updated

9 months ago

docker pull eurotech/mqtt-ws-proxy:0.1.7-rocky