Simple MQTT-based chat room client written in Ruby
Failed to load latest commit information.
.gitignore Initial commit Jan 14, 2013 minor formatting tweaks to gfm Jan 14, 2013
mqtt-chat.rb Initial commit of fixed / updated code Jan 14, 2013

Simple MQTT-based chat room client written in Ruby


  1. Install and run an MQTT broker. mosquitto is one choice, this also works with RabbitMQ version 3 which includes MQTT support, and with many other MQTT servers.

  2. Install the mqtt and ncurses-ruby gems (NB the plain ncurses gem is harder to natively compile)

    sudo gem install mqtt ncurses-ruby


  1. Run the client

    ruby ./mqtt-chat.rb <username>

  2. If you want to configure the app to run against an alternative MQTT broker running on a different host/post. Modify this line:

    mqtt ='localhost')

    replacing 'localhost' with the hostname or IP address of your chosen broker, optionally with a port number, e.g.

    mqtt ='', 1883)


Modified from simple AMQP-based and MQTT-based chat servers originally published as Gists by glejeune

Changes from original

  • added exit handler for cleaner end
  • updated for newer ruby-mqtt gem
  • fixed help text
  • updated README