A simple real-time chat application built with Go, featuring WebSocket-based communication. Users can connect to the server via a command-line interface (CLI) and exchange messages in real-time.
- Real-time communication using WebSockets.
- User-friendly CLI for connecting and chatting.
- Message timestamps for better context.
- Usernames for personalized communication.
- Temporary message storage (up to 1 hour) for new clients to see recent chat history.
- Go (1.23.4 or higher)
-
Clone the repository:
git clone https://github.com/pefman/shitshat.git cd shitshat
-
Build the project:
go build -o shitshat main.go
-
Run the application:
-
Start the server:
./shitshat --server --address <address> --port <port>
-
Start the client: Open a new terminal and run:
./shitshat --client --address <address> --port <port>
-
Enter your username when prompted and start chatting!
-
Repeat the client step in multiple terminals to test real-time chat functionality.
-
-
Test the application:
- Open multiple terminals and start the client in each one.
- Use different usernames for each client.
- Send messages from one client and see them appear in real-time on all connected clients.
- New clients will receive the last hour's chat history upon connecting.
You can also build and run the application using Docker.
-
Build the Docker image:
./build_docker_image.sh
-
Run the Docker container:
docker run -p <port>:<port> shitshat --server --address <ip> --port <port>
-
Connect clients to the server using the same steps as above, but ensure the address and port match the Docker container settings.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.