https://github.com/aws/s2n-quic Skip to content Sign up * Why GitHub? + Features + Mobile + Actions + Codespaces + Packages + Security + Code review + Issues + Integrations + GitHub Sponsors + Customer stories * Team * Enterprise * Explore + Explore GitHub + Learn and contribute + Topics + Collections + Trending + Learning Lab + Open source guides + Connect with others + The ReadME Project + Events + Community forum + GitHub Education + GitHub Stars program * Marketplace * Pricing + Plans + Compare plans + Contact Sales + Education [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this organization All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} aws / s2n-quic Public * Notifications * Fork 3 * Star 51 * An implementation of the IETF QUIC protocol crates.io/crates/s2n-quic Apache-2.0 License 51 stars 3 forks Star Notifications * Code * Issues 166 * Pull requests 7 * Actions * Security * Insights More * Code * Issues * Pull requests * Actions * Security * Insights This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 18 branches 1 tag Code Latest commit @camshaft camshaft docs: add description and repository to Cargo.toml (#1185) ... a19457f Feb 17, 2022 docs: add description and repository to Cargo.toml (#1185) a19457f Git stats * 741 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github ci: gate authenticated steps to 1st-party branches (#1181) Feb 17, 2022 common docs: add description and repository to Cargo.toml (#1185) Feb 17, 2022 docs docs: move from awslabs to aws (#1159) Feb 15, 2022 examples examples: add an example on how to use the events framework (#1179) Feb 17, 2022 quic docs: add description and repository to Cargo.toml (#1185) Feb 17, 2022 scripts docs: move from awslabs to aws (#1159) Feb 15, 2022 specs compliance: general cleanup (#1147) Feb 10, 2022 .dockerignore Plot performance benchmark graphs (#756) Aug 2, 2021 .gitattributes ci: restore fuzz corpus snapshots (#53) Jul 27, 2020 .gitignore transport: remove excessive allocations in poll_wakeups (#768) Jul 28, 2021 .license-template Add copyright notice to files (#565) Mar 10, 2021 .rustfmt.toml Add copyright notice to files (#565) Mar 10, 2021 CODE_OF_CONDUCT.md Initial commit Jun 25, 2020 CONTRIBUTING.md Add security issue notifications to readme (#1177) Feb 16, 2022 Cargo.toml s2n-quic-tls: depend on published crate (#1149) Feb 9, 2022 LICENSE Initial commit Jun 25, 2020 NOTICE Initial commit Jun 25, 2020 README.md Fix provider link (#1186) Feb 17, 2022 rust-toolchain Update to Rust 1.53 (#1038) Dec 10, 2021 View code [ ] s2n-quic Installation Example Server Client Minimum Supported Rust Version (MSRV) Security issue notifications License README.md s2n-quic s2n-quic is a Rust implementation of the IETF QUIC protocol, featuring: * a simple, easy-to-use API. See an example of an s2n-quic echo server built with just a few API calls * high configurability using providers for granular control of functionality * extensive automated testing, including fuzz testing, integration testing, unit testing, snapshot testing, efficiency testing, performance benchmarking, interopability testing and more * integration with s2n-tls, AWS's simple, small, fast and secure TLS implementation, as well as rustls * thorough compliance coverage tracking of normative language in relevant standards * and much more, including CUBIC congestion controller support, packet pacing, Generic Segmentation Offload support, Path MTU discovery, and unique connection identifiers detached from the address See the API documentation and examples to get started with s2n-quic. Crates.io docs.rs Apache 2.0 Licensed Build Status Dependencies MSRV Installation s2n-quic is available on crates.io and can be added to a project like so: [dependencies] s2n-quic = "1" NOTE: On unix-like systems, s2n-tls will be used as the default TLS provider and requires a C compiler to be installed. Example The following implements a basic echo server and client. The client connects to the server and pipes its stdin on a stream. The server listens for new streams and pipes any data it receives back to the client. The client will then pipe all stream data to stdout. Server // src/bin/server.rs use s2n_quic::Server; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let mut server = Server::builder() .with_tls(("./path/to/cert.pem", "./path/to/key.pem"))? .with_io("127.0.0.1:4433")? .start()?; while let Some(mut connection) = server.accept().await { // spawn a new task for the connection tokio::spawn(async move { while let Ok(Some(mut stream)) = connection.accept_bidirectional_stream().await { // spawn a new task for the stream tokio::spawn(async move { // echo any data back to the stream while let Ok(Some(data)) = stream.receive().await { stream.send(data).await.expect("stream should be open"); } }); } }); } Ok(()) } Client // src/bin/client.rs use s2n_quic::{client::Connect, Client}; use std::{error::Error, net::SocketAddr}; #[tokio::main] async fn main() -> Result<(), Box> { let client = Client::builder() .with_tls(CERT_PEM)? .with_io("0.0.0.0:0")? .start()?; let addr: SocketAddr = "127.0.0.1:4433".parse()?; let connect = Connect::new(addr).with_server_name("localhost"); let mut connection = client.connect(connect).await?; // ensure the connection doesn't time out with inactivity connection.keep_alive(true)?; // open a new stream and split the receiving and sending sides let stream = connection.open_bidirectional_stream().await?; let (mut receive_stream, mut send_stream) = stream.split(); // spawn a task that copies responses from the server to stdout tokio::spawn(async move { let mut stdout = tokio::io::stdout(); let _ = tokio::io::copy(&mut receive_stream, &mut stdout).await; }); // copy data from stdin and send it to the server let mut stdin = tokio::io::stdin(); tokio::io::copy(&mut stdin, &mut send_stream).await?; Ok(()) } Minimum Supported Rust Version (MSRV) s2n-quic will maintain a rolling MSRV (minimum supported rust version) policy of at least 6 months. The current s2n-quic version is not guaranteed to build on Rust versions earlier than the MSRV. The current MSRV is 1.53.0. Security issue notifications If you discover a potential security issue in s2n-quic we ask that you notify AWS Security via our vulnerability reporting page. Please do not create a public github issue. If you package or distribute s2n-quic, or use s2n-quic as part of a large multi-user service, you may be eligible for pre-notification of future s2n-quic releases. Please contact s2n-pre-notification@amazon.com. License This project is licensed under the Apache-2.0 License. About An implementation of the IETF QUIC protocol crates.io/crates/s2n-quic Topics rust cryptography quic s2n Resources Readme License Apache-2.0 License Code of conduct Code of conduct Stars 51 stars Watchers 9 watching Forks 3 forks Releases 1 tags Packages 2 Contributors 11 * @camshaft * @WesleyRosenblum * @toidiu * @rday * @maddeleine * @lrstewart * @seebees * @Matthias247 * @baldwinmatt * @dougch * @amazon-auto Languages * Rust 97.8% * JavaScript 1.3% * Shell 0.5% * Python 0.3% * HTML 0.1% * Dockerfile 0.0% * (c) 2022 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.