Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/njh/mqtt-http-bridge
MQTT to HTTP bridge
https://github.com/njh/mqtt-http-bridge
http mqtt ruby
Last synced: about 2 months ago
JSON representation
MQTT to HTTP bridge
- Host: GitHub
- URL: https://github.com/njh/mqtt-http-bridge
- Owner: njh
- License: mit
- Created: 2012-01-09T22:53:39.000Z (almost 13 years ago)
- Default Branch: main
- Last Pushed: 2023-03-16T05:41:26.000Z (almost 2 years ago)
- Last Synced: 2024-04-14T09:23:13.402Z (9 months ago)
- Topics: http, mqtt, ruby
- Language: Ruby
- Homepage: http://test-mosquitto.herokuapp.com/
- Size: 52.7 KB
- Stars: 116
- Watchers: 8
- Forks: 19
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
mqtt-http-bridge.rb
===================This simple web application provides a bridge between HTTP and [MQTT] using
a [REST]ish interface. It is possible to GET, POST, PUT and DELETE retained messages
on a remote MQTT server.Getting started
---------------Install bundler:
sudo gem install bundler
Install the other gem dependencies:bundle install
Run the local web server:
bundle exec rackup -p 1234
You can then open the bridge in your browser:
http://localhost:1234/
To connect to your own MQTT server:
Edit the first few lines of `mqtt-http-bridge.rb` to match your server.
If you want to use a different port than the default 1883, add `:remote_port => [PORT NUMBER],` under the line with the IP address. Do not put the port number in quotation marks.Examples using curl
-------------------To get a retained value for a topic:
curl http://localhost:1234/test
To publish to a topic (retained):
curl -X PUT --data-binary "Hello World" http://localhost:1234/test
To publish to a topic (non-retained):
curl -X POST --data-binary "Hello World" http://localhost:1234/test
To delete the retained value for a topic:
curl -X DELETE http://localhost:1234/test
License
-------The ruby mqtt-http-bridge is licensed under the terms of the MIT license.
See the file LICENSE for details.Contact
-------* Author: Nicholas J Humfrey
* Twitter: [@njh](http://twitter.com/njh)
* Home Page: http://www.aelius.com/njh/[MQTT]: https://en.wikipedia.org/wiki/MQTT
[REST]: http://en.wikipedia.org/wiki/Representational_state_transfer