Sending SPS message via HTTP using the sps_mqtt_bridge gem

require 'sps_mqtt_bridge'

bridge = host: '', port: 59000
bridge.sps_to_http(topic: 'rosa',  \
  url: "$topic&msg=$msg", \
  http_auth: ['user', 'password'])

The above examples shows how the sps_mqtt_bridge can be used to subscribe to an SPS topic, and have any received messages forward to a web server.


  1. The $topic and $msg variables are replaced with the actual string values within the URL
  2. A block can be passed to the sps_to_http() method to allow the IP address used in the URL to be refreshed or updated when a new message is received
  3. This example demonstrates publishing a message to a web server which uses basic http authentication. It should be able to publish to a web server which doesn't require authentication, although I haven't tested that as yet.