📬 A HTTP to MQTT proxy 📬
Supported JSON format (all formats bellow are valid, some just use the default values):
{
"broker": "broker.com",
"topic": "door"
}
{
"broker": "ws://broker.com",
"topic": "door"
}
{
"broker": "tcp://broker.com:2222",
"topic": "door"
}
{
"broker": "broker.com",
"username": "user1",
"password": "qwerty",
"topic": "door"
}
{
"broker": "broker.com",
"topic": "door",
"qos": 1
}
{
"broker": "broker.com",
"topic": "door",
"payload": "open"
}
{
"broker": "broker.com",
"topic": "door",
"payloadType": "string",
"payload": "open"
}
{
"broker": "broker.com",
"topic": "door",
"payloadType": "base64",
"payload": "AAEC"
}
{
"broker": "broker.com",
"topic": "door",
"payloadType": "json",
"payload": {
"doorNumber": 1,
"state": "open"
}
}
{
"broker": "broker.com",
"message": {
"topic": "door",
"payload": "open"
}
}
{
"broker": "broker.com",
"messages": [
{
"topic": "door",
"payload": "open"
},
{
"topic": "light"
}
]
}
Only one message can be sent per request:
curl -H 'X-Broker: broker.com' -H 'X-Username: user1' -H 'X-Password: qwerty' --data-raw "open" localhost:8080/door
is equivalent to:
{
"broker": "broker.com",
"username": "user1",
"password": "qwerty",
"topic": "door",
"payload": "open"
}
Only one message can be received per request:
curl -X GET -H 'X-Broker: broker.com' -H 'X-Username: user1' -H 'X-Password: qwerty' -H 'Accept: text/plain' localhost:8080/door
will wait up to 5 min for a message on the door
topic and will return the payload in the response's body.
Specifying Accept: plain/text
will cast / force the message's payload to be cast to a string, discarding invalid UTF-8 parts.
- No TLS/SSL broker connection support
- No multi-level wildcard subscribe (#)