💬Simple Chat Application in Java (TCP Client-Server) | Java Networking📡
🌐Description->
This is a basic console-based chat system built with Java using TCP socket programming. The application follows a client-server architecture, where the server listens for incoming client connections and facilitates real-time communication between connected clients, also enable you to see ip addresses, list of connected clients. You can add as many features/functionalies as you can.🚀
💠Supports multiple clients connecting to the server.
💠Real-time message exchange using TCP sockets.
💠Splits messages using "$" for processing.
💠Recognizes keywords like send, ip for specific actions.
💠Console-based chat interface.
💠Simple and efficient implementation of networking concepts.
💠Built for learning Java & networking, not real-world production use.
✔ Use any IDE like Netbeans, Intellij IDEA, VS code or follow the instructions below-
-
Compile the Java Files
Ensure you have Java & JDK installed on your system. Open a terminal or command prompt and navigate to the directory where the Java files are stored & use the following commands.
-javac Server.java
-javac Client.java -
Start the Server
-Run the following command to start the server:
-java Server
The server will start and wait for client connections.
- Start the Client
In a new terminal window, run the client application:
-java Client
You can start multiple clients by using IDE or opening additional terminals and running the same command.(IDE SS below)
👉Start the server first.
👉Run one or more clients.
👉Clients can send messages to the server and the server will broadcast messages/ip to all connected clients.
👇Server starts...
👇ClientMain starts...
👇How to run multiple clients -> go to the 3dot icon -> edit configuration -> Go to the + icon above application -> create another client under clientMain -> SS below for clear understanding-
👇Client2 (Taoshif) starts...
👇Client2 (Taoshif) requested for list(connected clients)-
👇ClientMain requested for ip address-
👇ClientMain sent a message to Client2(Taoshif)-

👇Client2 (Taoshif) recieved and replied to ClientMain-

[You can chat like this using the same wifi network but from different computers, no problem. Also as i am running both clients from the same computer thats why the ip is same]
👇ServerMain the whole time-
- Server starts first and listens for connections. ⚡
- Clients connect and send messages. 💬
- Messages are processed using "$" to differentiate parts. ✉️
- Special keywords like send, ip, lists trigger certain actions. 📝
- Messages are delivered to respective clients via TCP. 📡
💠Adding GUI (JavaFX, Swing) for a user-friendly interface 🖥️
💠Implementing encryption for secure communication 🔒
💠Improving scalability for handling more users 🌍
- Clone the repository: git clone [GitHub Repo Link] 🖥️
- Open in IntelliJ IDEA (or any Java IDE) 💡
- Run ServerMain.java first, then ClientMain.java
▶️ - Create multiple clients.(Optional) 💬
- Start chatting! 🎉
💡This project was created for learning Java networking. Inspired by how modern chat applications work! 🔥
💡Feel free to contribute to this project or reach out with suggestions!💬
💡This README provides all necessary details to set up and use the chat application. Let me know if you need modifications!👨💻






