Skip to content

Latest commit

 

History

73 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MQTT-Client

A MQTT client built in Crystal.

Installation

  1. Add the dependency to your shard.yml:
dependencies:
  mqtt-client:
    github: 84codes/mqtt-client.cr
  1. Run shards install

Usage

require "mqtt-client"

mqtt = MQTT::Client.new("localhost", 1883)

mqtt.on_message do |msg|
  puts "Got a message, on topic #{msg.topic}: #{String.new(msg.body)}"
end

mqtt.subscribe("foo", qos: 1)

mqtt.publish("foo", "bar", qos: 1)

mqtt.close

About

MQTT client built in Crystal

Topics

Resources

Stars

6 stars

Watchers

11 watching

Forks

Releases

Packages

Used by

Contributors

Languages