An open API service indexing awesome lists of open source software.

https://github.com/studyresearchprojects/rust-cli-chat

Rust Client & Server CLI Chat Application
https://github.com/studyresearchprojects/rust-cli-chat

chat mpsc rust streams sync tcp

Last synced: about 1 month ago
JSON representation

Rust Client & Server CLI Chat Application

Awesome Lists containing this project

README

          



rust-cli-chat


Rust Client & Server CLI Chat Application

## Motivation

Explore Rust threads, TCP streams and channels.

## Getting Started

- Run the `server` crate

```bash
cd server && cargo run
```

A TCP listener will bind to `127.0.0.1:6000`, awating for connections.

```log
➜ server git:(main) cargo run
Compiling server v0.1.0 (/projects/rust-cli-chat/server)
Finished dev [unoptimized + debuginfo] target(s) in 0.78s
Running `target/debug/server`
Client 127.0.0.1:56795 connected
```

Then you must run the `client` crate in another terminal window or tab.

```bash
cd client && cargo run
```

A connection to the TCP listener on `127.0.0.1:6000` will be established
and you will be prompted to write a message:

```log
➜ client git:(main) cargo run
Compiling client v0.1.0 (/projects/rust-cli-chat/client)
Finished dev [unoptimized + debuginfo] target(s) in 0.78s
Running `target/debug/client`
Write a message:
```