An easy to user Docker container that starts several MQTT Mosca brokers, handling massive connections simultaneously.
These instructions will get you a copy of the project up and running.
- You must have an active account on Auth0
- Once you account is activated, you must create a Machine-to-Machine (M2M) API in Auth0. See this very useful tutorial for more details.
- Copy the env.example file and change its contents to match both Auth0 API configuration and deployment mode
- Build and run the Docker compose command
cd <your_project_folder>
docker-compose build
docker-compose up
The server should be available for connection at port 1883
Happy messaging! =)
- By default, the docker compose file is set to create 5 Mosca replicas. If you are handling a huge number of connections simultaneously, you might wanna increase this number.
- In order to authenticate any potential listeners/subscriber, the server uses JWT authentication.
- By default, subscribers after authentication can only send/listen messages to topics which contains the client_id in their name. So in order to publish messages, you need to keep tabs on the subscription client_id.
- NodeJS - Javascript runtime used for the code
- HAProxy - Lightweight TCP Load balancer
- Redis - Default message persistence layer/in-memory database
- Mosca - Incredible MQTT Node.js broker
- Auth0 - JWT Device authentication service
For instructions on how to contribute, please contact the the author directly.
- Gabriel Natucci - Initial work - Digseed
This project is licensed under the MIT License - see the LICENSE.md file for details
- Based on the library to connect Auth0 and the Mosca Server, provided by @eugenioip