Coder Social home page Coder Social logo

chat-mqtt-cool's Introduction

Chat Demo - HTML Client

The Chat Demo is a very simple chat application based on MQTT.Cool.

Live Demo

Live Demo

Details

The Chat Demo implements an extremely simple chat application, which shows a basic usage of the MQTT.Cool Web Client API to handle communications with MQTT.Cool. All the users connected to the page can exchange messages, therefore launch multiple instances of the demo, possibly on different machines, to appreciate the message broadcast capability.

Check out the sources for further explanations.

Overall Architecture

Here the overall architecture of the demo:

Install

If you want to install a version of this demo pointing to your local MQTT.Cool, follows these steps.

  • As prerequisite, this demo needs an up and running MQTT broker. You can choose whatever MQTT broker you prefer, or may also use one of the available public broker (an up-to-date list is maintained at https://github.com/mqtt/mqtt.github.io/wiki/public_brokers).
  • Launch the MQTT.Cool server.
  • Download this project.
  • As the latest version of the MQTT.Cool JavaScript library is always available through unpkg, it is hot-linked in the html page.

Configure

The demo assumes that the MQTT.Cool server is launched from localhost, but if you need to target a different server, search in src/app.js this line:

const MQTT_COOL_URL = 'http://localhost:8080';

and change it accordingly.

Launch

Open your browser and point it to http://localhost:8080/ChatDemo, or to the address according to the host and/or the name of the folder where you deployed the project.

The demo is configured to establish an MQTT channel to the publicly accessible MQTT broker hosted at tcp://broker.mqtt.cool:1883, but fill free to provide any broker address through the relative form fields; then, click Connect to start.

See Also

MQTT.Cool Compatibility Notes

  • Compatible with MQTT.Cool SDK for Web Clients version 1.0.0 or newer.
  • Compatible with MQTT.Cool since version 1.0.3 b1 or newer.

chat-mqtt-cool's People

Contributors

gfinocchiaro avatar jobscale avatar

Watchers

 avatar  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.