A very simple client-server with a connection made using QUIC, using the quinn library.
This project was developed in just a few hours as part of a training exercise over the weekend.
-
Clone the repository:
git clone https://github.com/Matheus-git/quic-chat.git
-
Navigate to the project directory:
cd quic-chat
-
Configure client.rs and server.rs with the desired IPs and ports.
-
Generate the certificate ( and private key ) at certs/ .
cargo run --bin quic-chat
-
Start server:
cargo run --bin server
-
Start client (in another terminal):
cargo run --bin client
If you want to run the server and client on different hosts, you need to ensure that both use the same set of certificates. Follow the steps below:
-
Certificates
- Both the server and client must use the same certificate pair for the QUIC connection.
- The server will need both
cert.pem
(certificate) andcert.key
(private key) to work properly. - The client only needs the
cert.pem
(certificate), as it only validates the server's certificate during the connection.
-
Steps:
- Place the
cert.pem
andcert.key
files in the server’s directory. - On the client, copy only the
cert.pem
file to the appropriate directory.
- Place the
Make sure the certificate paths are correctly configured on both sides to ensure a secure connection.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is open-source under the MIT License.