Giter Site home page Giter Site logo

connectx.v2's Introduction

ConnectX.v2

This is a simple chat application built using Express.js and Socket.IO.

Initial Setup

  1. Make sure you have Node.js installed on your machine. You can download it from the official Node.js website: https://nodejs.org

  2. Clone this repository or download the source code.

  3. Open a terminal or command prompt and navigate to the project directory.

  4. Install the required dependencies by running the following command:

npm install express socket.io

Running the Server

To start the server, run the following command:

node server.js

The server will start running and will be accessible at http://localhost:3000.

You can now open multiple browser windows or tabs and visit http://localhost:3000 to chat with other connected clients.

Customizing the Whitelist

By default, the chat application allows only specific usernames to log in. To customize the whitelist and add or remove names, follow these steps:

  1. Open the server.js file in a text editor.

  2. Locate the following line:

    const authorizedUsers = ['user1', 'user2', 'user3']; // Add the authorized usernames here
  3. Add or remove usernames as desired within the square brackets ([]). For example, to allow 'user4' to log in, modify the line as follows:

const authorizedUsers = ['user1', 'user2', 'user3', 'user4']; // Add the authorized usernames here
  1. Save the server.js file.

  2. Restart the server by running the following command: node server.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.