Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oliverlorenz/http2mqtt
Bridges http requests to mqtt
https://github.com/oliverlorenz/http2mqtt
Last synced: 9 days ago
JSON representation
Bridges http requests to mqtt
- Host: GitHub
- URL: https://github.com/oliverlorenz/http2mqtt
- Owner: oliverlorenz
- Created: 2018-06-09T09:19:08.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-26T07:55:51.000Z (over 5 years ago)
- Last Synced: 2024-08-01T15:43:44.643Z (4 months ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 12
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# http2mqtt
This is simple as possible!
* connects to a MQTT Broker
* Starts a webserver
* takes http request path as topic and body as payload for MQTT
* Works with GET and POST method
* Prepared to use with Docker## usage
Start server:
```
docker run -it --rm -p 9001:9001 oliverlorenz/http2mqtt
```Connect MQTT client:
```
mosquitto_sub -h test.mosquitto.org -t "my/mqtt/topic"
```Then open up your browser and type in:
```
http://localhost:9001/my/mqtt/topic
```You will receive a "null" message in the client because, you don't send a payload. If you send payload, it will be visible there.
### Configuration
You can configure the project by using this environment variables
* BROKER_URL default: mqtt://test.mosquitto.org
* TOPIC_BASE
* HTTP_PORT default: 9001
* MQTT_USERNAME
* MQTT_PASSWORD