Skip to content

Larssies/Socket.io-Live-Chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Socket.io Live Chat Template

This is a simple template for creating a real-time chat application using Socket.io. The template includes a basic server-side setup with Express and Socket.io, as well as a client-side HTML and JavaScript code for the chat interface.

Getting Started

To use this template, follow these steps:

  1. Clone this repository to your local machine: git clone <repository_url>
  2. Install dependencies by running: npm install
  3. Start the server by running: npm start
  4. Open your web browser and navigate to http://localhost:<port> to view the live chat application.

Server Setup

The server is built using Express and Socket.io. It listens for incoming connections on the specified port (default is 80) and handles socket events such as connection, disconnection, and chat messages.

Client Setup

The client-side code is a simple HTML file with embedded JavaScript. It creates a chat interface with an input field for sending messages and a list to display incoming messages. It also includes a button to disconnect or reconnect to the chat server.

Dependencies

  • express: Fast, unopinionated, minimalist web framework for Node.js.
  • socket.io: Real-time bidirectional event-based communication library for web applications.

Usage

Once the server is running and you have opened the application in your web browser, you can start sending and receiving messages in real-time. Enter your message in the input field and press "Send" to send it to all connected clients.

You can also disconnect from the chat server by clicking the "Disconnect" button. To reconnect, simply click the button again.

Customization

Feel free to customize the chat interface, add additional features, or integrate the chat into your existing applications. You can modify the HTML, CSS, and JavaScript files to suit your needs.

License

This project is licensed under the MIT License.

About

A Socket.io live chat template

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published