Echat is a multi-user chat system where clients connect to a central server using a command-based protocol. The server handles:
- 🔒 User authentication
- 🛠️ Room creation and joining
- ✉️ Message distribution
- 🛡️ Administrative operations
💻 Clients use a dedicated Java program to manage socket communication, but also suports Telnet connections.
- Protocol: TCP
- Default Port:
42069 - Message Format: Plain text strings, ending with
\n
- Clients connect to the server via a TCP socket.
- Once connected, they can issue commands and receive responses.
<command> [arg1] [arg2] ...
- 📋 Commands: Case-insensitive
- 📂 Arguments: Space-separated
- ✅ Server Responses: Success, error, or informational messages
-
Register
register <username> <password>
➡️ Register a new user. -
Login
login <username> <password>
➡️ Authenticate as an existing user.
- Join Room:
join <room_name>
➡️ Join a chat room. - Create Room:
createroom <room_name> <PERMS>
➡️ Request a new chat room. - List Rooms:
listrooms
➡️ View available rooms. - Leave Room:
leave
➡️ Exit the current room.
- Room Message: Simply type your message.
➡️ Sends to everyone in the room. - Direct Message:
msg <username> <message>
➡️ Private message another user.
- List Users:
users
➡️ View users in the current room. - Logout:
logout
➡️ Sign out.
- Approve Room:
approveroom <room_name>
➡️ Approve a room creation. - Deny Room:
denyroom <room_name>
➡️ Deny a room creation. - Notify Users:
notify <PERMS> <message>
➡️ Send notifications to users.
- LOW: Basic users 🟢
- MEDIUM: Intermediate users 🟡
- HIGH: Admin users 🔴
Permissions affect room management, notifications, and approvals.
- Register:
register john password123 - Login:
login john password123 - Join a Room:
join General - Send a Message:
Hello, everyone!
- Login:
login admin adminpass - View Pending Requests:
listroomrequests - Approve a Room:
approveroom NewRoom
- Unknown Commands:
Unknown command. Type help for a list of commands. - Invalid Arguments:
Invalid command. Usage: <correct usage> - Permission Denied:
Insufficient permissions to execute this command.