Use NodeJs and Docker to build a distributed system comprising one server and four clients. Connect them via different ports. The Server and Clients will communicate via Broadcast and Multicast Protocol.
Install nodeJs from Homebrew:
brew install node
Initialize node on the project directory:
npm install -y
- Build the server.js for broadcasting
- Build the client.js for broadcasting
- Build the server.js for multicasting
- Build the client.js for multicasting
- Execute Server:
node Server
- Execute Client:
node Client
- Build server:
docker build -t server
- Build Client:
docker build -t client1 ./client && docker build -t client2 ./client && docker build -t client3 ./client && docker build -t client4 ./client
- Build Network:
docker network create project
- Run Server:
docker run --name server --network project server
- Run Client:
docker run --network project client1 && run --network project client2 && docker run --network project client3 && docker run --network project client4
- Stop Server:
docker stop server
docker rm server
- Testing Using Docker Testing