Giter Club home page Giter Club logo

mqtt-http-bridge's Introduction

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/

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

mqtt-http-bridge's People

Contributors

njh avatar varkokonyi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.