https://github.com/spageektti/local-network-chat
https://github.com/spageektti/local-network-chat
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/spageektti/local-network-chat
- Owner: spageektti
- License: gpl-3.0
- Created: 2024-08-15T16:24:29.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-09-09T18:06:09.000Z (8 months ago)
- Last Synced: 2025-01-09T01:48:27.549Z (4 months ago)
- Language: Python
- Size: 26.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Local Network Chat

This project implements a simple local network chat application using Python's `socket` and `threading` libraries. It consists of a chat server (`server.py`) and a chat client (`client.py`). Clients can connect to the server and exchange messages with each other in real time.## Features
- **Multi-client support**: The server can handle multiple clients simultaneously.
- **Broadcast messaging**: Messages from one client are broadcast to all connected clients.
- **Simple command-line interface**: Users can specify the server and client configuration via command-line arguments.## Requirements
- Python 3.x
## Usage
### 1. Start the Server
Run the `server.py` script to start the chat server.
```bash
python server.py --host 0.0.0.0 --port 12345
```- `--host`: The IP address to bind the server to. Default is `0.0.0.0` (binds to all available interfaces).
- `--port`: The port number to bind the server to. Default is `12345`.### 2. Start the Client
Run the `client.py` script to connect to the chat server.
```bash
python client.py --host 127.0.0.1 --port 12345
```- `--host`: The server's IP address to connect to. Default is `127.0.0.1`.
- `--port`: The server's port number to connect to. Default is `12345`.### 3. Chat!
Once the client is connected, type your messages and press Enter to send them. Messages from other clients will appear in the console.
## Example
Start the server:
```bash
python server.py --host 192.168.1.100 --port 8888
```Start the client:
```bash
python client.py --host 192.168.1.100 --port 8888
```Chat between multiple clients connected to the same server:
```text
You: Hello, everyone!
Server: Hi, welcome to the chat!
```## License
This project is licensed under the GNU General Public License v3.0. See the [LICENSE](LICENSE) file for details.
## Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
## Disclaimer
This is a basic implementation intended for educational purposes. It may not be secure or suitable for use in a production environment. Use at your own risk.