A simple TCP Chat Server written in JAVA.
Use Docker to build a Container image of TelnyChat. Build process will do:
- Download and install OpenJDK : The JAVA environment to execute the Chat.
- Download and install Maven : To compile and build source code.
- Copy locale source into docker image.
- Do Maven Build, executing Integration Test Suite, and generating the executable Java archive.
- Configure Launch Command and Container local Port.
docker build -f Dockerfile -t telnychat:1.0.0 .
Use Docker to run builded image as Container Run process will start new Container, binding 10000 host port to 10000 Container port.
docker run --name telnychat -i -d --rm -p 10000:10000 telnychat:1.0.0
Server listens on port 10000.
- Connect using a telnet Cient, like Putty (Select RAW mode)
- Entar a nickname
- Chat (Don't use special char "|", because it is a reserved char).
After logging in, you will be subscripted on a Default Channel (Topic), where clients can share their messages. So, your messages will be sended to all connected clients.
You can also submit to the server some simple commands. Commands supported are:
- ___GET_CLIENTS : Get a list of all connected clients.
- ___GET_TOPICS : Get a list of all active Channels (Topics).
- ___BROADCAST_TO_TOPIC : Send a message to all Clients with a subscription on a Topic. *
- ___DISCONNECT : Disconnect from the Chat
About ___BROADCAST_TO_TOPIC command: The message's format to use with this Command is: COMMAND|TOPIC|MESSAGE (Es.: ___BROADCAST_TO_TOPIC|HOBBY|Do you like to play football?) To Send a message on the Default Channel, you can simply write the MESSAGE, without specifying the ___BROADCAST_TO_TOPIC command and it's format.