this code is just for demonstration purposes using javascript Paho Client over web sockets and java with as a subscriber, this code is not meant for production it is part of project teaching course Internet of things.
require MQTT message broker that run on port 1383 like Mosquitto and on port 9001 for websockets.
git clone https://github.com/samyouaret/MQTT_with_mosquitto_over_websockets_example.git