UDP-CHAT is a chat made in Golang which simulates a real-time chat using a UDP server.
- The last 20 messages are stored into a Redis with an expiry time of 20 minutes.
- If the server took more than 5 seconds to reply, the connection is closed (timeout set as 5 sec)
This project requires DOCKER
and GOLANG
installed in your machine.
6380
- REDIS
8000
- SERVER
To install & run the chat is pretty simple, all the steps have been added to a shell script and we can run it as a makefile.
On the main project folder {project_path}/udp-chat
, run the following commands:
make server
-> Initialize Docker adding the REDIS
container and running the SERVER
on port 8000
make client
-> Runs a CLIENT
instance which listen on server port 8000.
If you want to stop the server, go to the project folder again and type make server-stop
You can see every action made on REDIS using the client redis-cli
.
Just open a new terminal and type: redis-cli -p 6380
then monitor
. If you get an OK
you will see every action made on REDIS.