Skip to content

appidom/mqtt-http-bridge

 
 

Repository files navigation

mqtt-http-bridge.rb

This simple web application provides a bridge between HTTP and MQTT using a RESTish 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/

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

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 73.4%
  • HTML 13.4%
  • CSS 12.2%
  • Shell 1.0%