TCP Chat is a simple and concurrent chat server and client written in Go, allowing users to connect and chat in real-time over a TCP network connection. It features unique usernames, chat history, and support for multiple simultaneous connections.
- Connect to the chat server using a specified host and port.
- Unique usernames for each client.
- Chat history is maintained and displayed to new clients when they join.
- Real-time chat with other connected users.
- Maximum of 10 users can connect simultaneously.
Follow these instructions to get a copy of the project up and running on your local machine.
- Go (Go 1.16 or later)
-
Clone the repository:
git clone https://github.com/yourusername/tcp-chat.git
-
Change into the project directory:
cd tcp-chat -
Build the server and client:
go build -o TCPChat ./cmd/server
To run the TCP Chat server, use the following command:
./TCPChat [host] [port]- [host] (optional): The host to bind the server to. Default is "localhost".
- [port] (optional): The port number to listen on. Default is "8989".
Run the server on the default host and port:
./TCPChatRun the server on a custom host and port:
./TCPChat 0.0.0.0 9999- Connect to the server using a TCP client, such as Telnet or netcat, or use the provided TCPChatClient binary.
- Enter your desired username when prompted.
- Start chatting with other connected users.
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
Authors Tr8ch
