Dive into the Wild West with Saloon!
Saloon is a chat application that provides a platform for real-time communication. The project is divided into two main components: the server and the client.
The server acts as the central hub for message distribution. It is designed to handle client connections using UDP (User Datagram Protocol) for efficient, low-latency communication. Key features include:
- Listening for client connections and managing their session.
- Handling unicast messages from clients and broadcasting them to other connected clients using multicast.
- Supporting private messages between clients, routed through the server.
- Maintaining a list of all connected users for retrieval.
The client interface offers a user-friendly environment for interaction within the Saloon network. Features include:
- Connecting to the server with a unique username.
- Sending messages to the server in unicast, which are then broadcasted to other clients.
- Private messaging capabilities, allowing direct communication with selected users.
- Ability to request and view a list of all connected users.
- Docker Support: Both the server and client components are Dockerized, enabling easy deployment and scalability. The application is tested to work flawlessly in Docker environments, with special consideration for network configurations and inter-container communication.
For a detailed understanding of the communication protocol used in Saloon, please refer to the protocol definition available at: Saloon Protocol Definition
You can package the jar file directly by using the maven wrapper packaged into the project. If you use Intellij IDE, the packaging configuration is embedded into the project.
- Clone the Pongly repository:
git clone https://github.com/CoJaques/Saloon- Change to the project directory:
cd Saloon- Build the client and the server:
# Download the dependencies
./mvnw dependency:resolve clean compile
# Package the application
./mvnw packageOnce the Jar are generated, you can build the docker images.
-
Server Image:
- Navigate to the server's directory.
- Build the image using the Docker build command.
docker build -t ghcr.io/cojaques/saloon_server:v1.0.0 .
-
Client Image:
- Navigate to the client's directory.
- Build the image similarly.
docker build -t ghcr.io/cojaques/saloon_client:v1.0.0 .
be sure to adapt the version number as needed.
After building the images, you can publish them to github. Be sure to be logged and have right to publish image.
Once done, you can publish it to github by using :
docker push ghcr.io/cojaques/saloon_client:v1.0.0
docker push ghcr.io/cojaques/saloon_server:v1.0.0-
Running with Docker Compose:
- In the directory containing your
docker-compose.yml, start the services.docker-compose up
- This will pull the images from github and start the server and clients.
- In the directory containing your
-
Interacting with the Application:
Once the containers are running, interact with the client as you normally would in a local setup. You can connect to the client/server terminal by using
docker attach <docker ID>
Once connected, you must connect yourself to the server by using
/connect <your username>
From here, you can chat with everybody by simply sending simple message. You can get a list of who's connected by sending
/who
You can send private message by using
/mp <target username> your message
Finally you can quit the application by simply sending
/quit
-
Shutting Down the Application:
- To stop the application, use:
docker-compose down
- To stop the application, use:
To run the application without docker compose follow the guide :
First you must pull the image.
docker pull ghcr.io/cojaques/saloon_client:v1.0.0
docker pull ghcr.io/cojaques/saloon_server:v1.0.0To run the Saloon client using Docker, execute the following command with the desired options:
docker run ghcr.io/cojaques/saloon_client:v1.0.0 [options]-UP, --UniPort: The unicast port of the server to connect to. Default is set as per1312.-MP, --MultiPort: The multicast port of the server for group communications. Default is set as per1313.-H, --DefaultHost: The server host address to connect to. Default is192.168.23.23.-M, --MultiCastAddress: The multicast address of the server. Default is239.1.1.1.-A, --Adapter: Define the network adapter to use for the multicast.
To run the Saloon server using Docker, execute the following command with the necessary options:
docker run ghcr.io/cojaques/saloon_server:v1.0.0 [options]-UP, --UniPort: The unicast port of the server for receiving client messages. Default is set as per1312.-MP, --MultiPort: The multicast port of the server for broadcasting messages. Default is set as per1313.-M, --MultiCastAddress: The multicast address used by the server. Default is239.1.1.1.-A, --Adapter: Specify the network adapter to use for handling multicast traffic.
This readme was, in part, generated by an AI