v1.2.4
This program consists of two scripts: client.js and server.js, which together create a simple chat application. Here's a description of each:
-
client.js:
- This script allows a user to connect to the chat server and send messages.
- It prompts the user to enter a username and establishes a connection with the server over TCP.
- Upon connection, it sends an initial message to the server for authentication purposes.
- It encrypts user messages using a simple encryption algorithm before sending them to the server.
- It listens for user input from the command line and sends messages or commands to the server.
- It decrypts and displays incoming messages from the server, distinguishing between server-generated messages and messages from other users.
- It gracefully handles disconnection from the server.
-
server.js:
- This script creates a TCP server that listens for incoming connections from clients.
- Upon connection, it assigns a unique ID to the client and stores its socket for communication.
- It validates the client's version number upon receiving an initial message and allows or refuses the connection based on compatibility.
- It broadcasts messages sent by clients to all other connected clients.
- It handles special commands, such as sending the current server time upon request.
- It sends join and leave messages to all clients when a user joins or leaves the chat.
- It gracefully handles client disconnection.
enchancements
- added encryption
- added logic to create commands
- added proofing to inputs in order to avoid being able to send empty messages
- colors to make the interface easier to read
What's Changed
- 1.2.0 by @serangelicloud in #5
- 1.2.1 by @serangelicloud in #6
- 1.2.2 by @serangelicloud in #7
- 1.2.3 by @serangelicloud in #8
- 1.2.4 by @serangelicloud in #9
Full Changelog: v1.2.0...v1.2.4