• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:with +full:- +full:quiche

1 ![quiche](quiche.svg)
3 [![crates.io](https://img.shields.io/crates/v/quiche.svg)](https://crates.io/crates/quiche)
4 [![docs.rs](https://docs.rs/quiche/badge.svg)](https://docs.rs/quiche)
5 …](https://img.shields.io/github/license/cloudflare/quiche.svg)](https://opensource.org/licenses/BS…
6 ![build](https://img.shields.io/github/actions/workflow/status/cloudflare/quiche/stable.yml?branch=…
8 [quiche] is an implementation of the QUIC transport protocol and HTTP/3 as
11 (e.g. sockets handling) as well as an event loop with support for timers.
13 For more information on how quiche came about and some insights into its design
16 [quiche]: https://docs.quic.tech/quiche/
18 [post]: https://blog.cloudflare.com/enjoy-a-slice-of-quic-and-rust/
20 Who uses quiche?
21 ----------------
25 quiche powers Cloudflare edge network's [HTTP/3 support][cloudflare-http3]. The
26 [cloudflare-quic.com](https://cloudflare-quic.com) website can be used for
31 Android's DNS resolver uses quiche to [implement DNS over HTTP/3][android-http3].
35 quiche can be [integrated into curl][curl-http3] to provide support for HTTP/3.
39 quiche can be [integrated into NGINX](nginx/) using an unofficial patch to
42 [cloudflare-http3]: https://blog.cloudflare.com/http3-the-past-present-and-future/
43 [android-http3]: https://security.googleblog.com/2022/07/dns-over-http3-in-android.html
44 [curl-http3]: https://github.com/curl/curl/blob/master/docs/HTTP3.md#quiche-version
47 ---------------
49 ### Command-line apps
51 Before diving into the quiche API, here are a few examples on how to use the
52 quiche tools provided as part of the [quiche-apps](apps/) crate.
57 $ cargo run --bin quiche-client -- https://cloudflare-quic.com/
63 $ cargo run --bin quiche-server -- --cert apps/src/bin/cert.crt --key apps/src/bin/cert.key
66 (note that the certificate provided is self-signed and should not be used in
69 Use the `--help` command-line flag to get a more detailed description of each
74 The first step in establishing a QUIC connection using quiche is creating a
78 let mut config = quiche::Config::new(quiche::PROTOCOL_VERSION)?;
79 config.set_application_protos(&[b"example-proto"]);
88 QUIC is a general-purpose transport protocol and there are several
91 is dependent on the application running over QUIC, and other use-case
94 quiche defaults several properties to zero, applications most likely need
97 - [`set_initial_max_streams_bidi()`]
98 - [`set_initial_max_streams_uni()`]
99 - [`set_initial_max_data()`]
100 - [`set_initial_max_stream_data_bidi_local()`]
101 - [`set_initial_max_stream_data_bidi_remote()`]
102 - [`set_initial_max_stream_data_uni()`]
112 On the client-side the [`connect()`] utility function can be used to create
117 let conn = quiche::connect(Some(&server_name), &scid, local, peer, &mut config)?;
120 let conn = quiche::accept(&scid, None, local, peer, &mut config)?;
134 let recv_info = quiche::RecvInfo { from, to };
157 Err(quiche::Error::Done) => {
173 timer to react to time-based connection events. The timer expiration can be
194 Err(quiche::Error::Done) => {
212 avoid creating packet bursts that could cause short-term congestion and
215 quiche exposes pacing hints for outgoing packets through the [`at`] field
221 packets through platform-specific mechanisms (such as the [`SO_TXTIME`]
222 socket option on Linux), or custom methods (for example by using user-space
225 [pace]: https://datatracker.ietf.org/doc/html/rfc9002#section-7.7
226 [`SO_TXTIME`]: https://man7.org/linux/man-pages/man8/tc-etf.8.html
263 The quiche [HTTP/3 module] provides a high level API for sending and
266 [`Config`]: https://docs.quic.tech/quiche/struct.Config.html
267 [`set_initial_max_streams_bidi()`]: https://docs.rs/quiche/latest/quiche/struct.Config.html#method.…
268 [`set_initial_max_streams_uni()`]: https://docs.rs/quiche/latest/quiche/struct.Config.html#method.s…
269 [`set_initial_max_data()`]: https://docs.rs/quiche/latest/quiche/struct.Config.html#method.set_init…
270 [`set_initial_max_stream_data_bidi_local()`]: https://docs.rs/quiche/latest/quiche/struct.Config.ht…
271 [`set_initial_max_stream_data_bidi_remote()`]: https://docs.rs/quiche/latest/quiche/struct.Config.h…
272 [`set_initial_max_stream_data_uni()`]: https://docs.rs/quiche/latest/quiche/struct.Config.html#meth…
273 [`with_boring_ssl_ctx()`]: https://docs.quic.tech/quiche/struct.Config.html#method.with_boring_ssl_…
274 [`connect()`]: https://docs.quic.tech/quiche/fn.connect.html
275 [`accept()`]: https://docs.quic.tech/quiche/fn.accept.html
276 [`recv()`]: https://docs.quic.tech/quiche/struct.Connection.html#method.recv
277 [`send()`]: https://docs.quic.tech/quiche/struct.Connection.html#method.send
278 [`timeout()`]: https://docs.quic.tech/quiche/struct.Connection.html#method.timeout
279 [`on_timeout()`]: https://docs.quic.tech/quiche/struct.Connection.html#method.on_timeout
280 [`stream_send()`]: https://docs.quic.tech/quiche/struct.Connection.html#method.stream_send
281 [`readable()`]: https://docs.quic.tech/quiche/struct.Connection.html#method.readable
282 [`stream_recv()`]: https://docs.quic.tech/quiche/struct.Connection.html#method.stream_recv
283 [HTTP/3 module]: https://docs.quic.tech/quiche/h3/index.html
285 Have a look at the [quiche/examples/] directory for more complete examples on
286 how to use the quiche API, including examples on how to use quiche in C/C++
289 [examples/]: quiche/examples/
291 Calling quiche from C/C++
292 -------------------------
294 quiche exposes a [thin C API] on top of the Rust API that can be used to more
295 easily integrate quiche into C/C++ applications (as well as in other languages
300 built automatically alongside the Rust one. This is fully stand-alone and can
304 is disabled by default), by passing ``--features ffi`` to ``cargo``.
306 [thin C API]: https://github.com/cloudflare/quiche/blob/master/quiche/include/quiche.h
309 --------
311 quiche requires Rust 1.66 or later to build. The latest stable Rust release can
314 Once the Rust build environment is setup, the quiche source code can be fetched
318 $ git clone --recursive https://github.com/cloudflare/quiche
324 $ cargo build --examples
334 based on TLS, needs to be built and linked to quiche. This is done automatically
335 when building quiche using cargo, but requires the `cmake` command to be
342 the BoringSSL directory with the ``QUICHE_BSSL_PATH`` environment variable:
345 $ QUICHE_BSSL_PATH="/path/to/boringssl" cargo build --examples
352 Building quiche for Android (NDK version 19 or higher, 21 recommended), can be
353 done using [cargo-ndk] (v2.0 or later).
360 $ export ANDROID_NDK_HOME=/usr/local/share/android-ndk
367 …$ rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-
372 [cargo-ndk] (v2.0 or later) also needs to be installed:
375 $ cargo install cargo-ndk
378 Finally the quiche library can be built using the following procedure. Note that
379 the `-t <architecture>` and `-p <NDK version>` options are mandatory.
382 $ cargo ndk -t arm64-v8a -p 21 -- build --features ffi
388 [cargo-ndk]: https://docs.rs/crate/cargo-ndk
389 [build_android_ndk19.sh]: https://github.com/cloudflare/quiche/blob/master/tools/android/build_andr…
393 To build quiche for iOS, you need the following:
395 - Install Xcode command-line tools. You can install them with Xcode or with the
399 $ xcode-select --install
402 - Install the Rust toolchain for iOS architectures:
405 $ rustup target add aarch64-apple-ios x86_64-apple-ios
408 - Install `cargo-lipo`:
411 $ cargo install cargo-lipo
417 $ cargo lipo --features ffi
423 $ cargo lipo --features ffi --release
433 $ make docker-build
436 You can find the quiche Docker images on the following Docker Hub repositories:
438 - [cloudflare/quiche](https://hub.docker.com/repository/docker/cloudflare/quiche)
439 - [cloudflare/quiche-qns](https://hub.docker.com/repository/docker/cloudflare/quiche-qns)
441 The `latest` tag will be updated whenever quiche master branch updates.
443 **cloudflare/quiche**
447 **cloudflare/quiche-qns**
449 Provides the script to test quiche within the [quic-interop-runner](https://github.com/marten-seema…
452 ---------
454 Copyright (C) 2018-2019, Cloudflare, Inc.
458 [COPYING]: https://github.com/cloudflare/quiche/tree/master/COPYING