go-chat-anonymous

command module
v0.0.0-...-29ca71d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

Go chat anonymous

This is a simple chat server implemented in Go, allowing multiple clients to connect to different chat rooms and exchange messages.

Chat with your friends anonymously by typing the same secret key!

Features:

  • Multiple Chat Rooms: Clients can join different chat rooms using a passkey.
  • Broadcast Messaging: Messages sent by one client are broadcasted to all clients in the same chat room.
  • Basic Command Handling: Clients can send messages and use the command "leave" to disconnect from the server.

Components:

  • main.go: Entry point of the server, responsible for listening to incoming connections and managing client connections.
  • server.go: Manages the overall server operation, including handling new connections, client management, and message broadcasting.
  • client.go: Represents a connected client, handles client-specific operations such as message sending and disconnection.

Usage:

  1. Clone the repository:

    git clone https://github.com/Vkanhan/go-chat-anonymous.git         
    cd go-chat-anonymous
    
    
  2. Starting the Server:

    • Run go run main.go to start the server. By default, it listens on port 8080.
  3. Connecting Clients:

    • Clients can connect to the server using any TCP client software (e.g., telnet, netcat).
    • Connect to the server's IP address and port (e.g., telnet localhost 8080).
    • Upon connection, clients are prompted to enter an anonymous name and a passkey to join a chat room.
  4. Sending Messages:

    • Clients can send messages to the chat room by typing their message. Messages are formatted as passkey|name: message.
  5. Leaving the Chat:

    • Clients can type leave to disconnect from the server and leave the chat room.

License:

This project is licensed under the Apache License Version 2.0 LICENSE. See the LICENSE file for details.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL