Simple, quick and lightweight chat built over TCP and Rust.
TCP Chat is a simple chat made in Rust with a communication over TCP. The purpose of this project is learn about parallelism and low-level network communication.
This project doesn't want to replace any tool or being a new way to communicate, is just for learn Rust and has several issues (such as non-encrypted packets).
Since the project is built with Tokio, the standard library and Tauri, TCP Chat is multiplatform.
To start using TCP Chat you need to clone repository, install dependencies and build locally.
# Clone the repo
git clone https://github.com/gatomod/tcp-chat.git
# Build the server
cargo build --release -p server
# Build the client
cd client
pnpm i
pnpm tauri buildThen run it
# Init server
target/release/server
# By default, server is on port 3000
# Add an env variable to edit it
PORT=4848 target/release/server
# Start client
target/release/tcp-chatThe server opens a TCP Listener. For each new connection spawns a thread and keeps open the connection. At this point, client and server can share the data (which is serialized in JSON, structs are defined in structs.rs).
When a connection sends a message, data is sent to server, which shares the packet between all threads and send the message to all connections.
Tauri receives the message and passes it to the web client.
- 1.0.0
- Initial release
TCP Chat is licensed under the GNU General Public License v.3.0.
Any PR is welcome! Is a small project so the guideline is to follow the code style and not make insane purposes.
Note: typo errors will be declined.
Web - Donate (via PayPal) - Discord - Revolt
Gátomo - GNU General Public License v.3.0 License