Skip to content

v1.2.4

Choose a tag to compare

@serangelicloud serangelicloud released this 09 Mar 07:19
· 40 commits to main since this release
9064c95

This program consists of two scripts: client.js and server.js, which together create a simple chat application. Here's a description of each:

  1. 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.
  2. 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

Full Changelog: v1.2.0...v1.2.4