Bind wildcard ephemeral port directly for QUIC preferred-address tests Preferred-address tests in `EndToEndTest::Initialize()` previously started the server bound to `TestLoopback()` on port 0, stopped it, and restarted it bound to `Any4()` or `Any6()` on that port. When test shards share a network namespace, another shard can already hold that port on another loopback address (such as `TestLoopback(2)`), causing the wildcard rebind to fail with `EADDRINUSE`. When `use_preferred_address_` is set, bind directly to `Any4()` or `Any6()` on port 0 in a single `StartServer()` call instead of starting on `TestLoopback()` and restarting. Defer configuring the server preferred address (`TestLoopback(2)`) until `ServerThread::Initialize()` assigns the ephemeral port, then update `server_address_`, `server_listening_address_`, `server_preferred_address_`, `server_config_`, and the server's `QuicConfig` via `QuicServerPeer::GetConfig()` before `ServerThread::Start()`. Also fix port reservation across server restarts in `StopServer()` and `StartServer()`: - Reset `server_thread_` in `StopServer()` after `Quit()`/`Join()` so the server's listening socket is closed before reserving the port. - Reserve `server_listening_address_` (when set) instead of `server_address_`. - Check the `bool` return value of `QuicUdpSocketApi::Bind()` instead of comparing against `< 0`, and destroy/reset `fd_` on bind failure. - In `StartServer()`, reset `server_thread_` and clean up `server_writer_` before failing if binding returns port 0. PiperOrigin-RevId: 1029149795
QUICHE stands for QUIC, Http, Etc. It is Google‘s production-ready implementation of QUIC, HTTP/2, HTTP/3, and related protocols and tools. It powers Google’s servers, Chromium, Envoy, and other projects. It is actively developed and maintained.
There are two public QUICHE repositories. Either one may be used by embedders, as they are automatically kept in sync:
To embed QUICHE in your project, platform APIs need to be implemented and build files need to be created. Note that it is on the QUICHE team's roadmap to include default implementation for all platform APIs and to open-source build files. In the meanwhile, take a look at open source embedders like Chromium and Envoy to get started:
To contribute to QUICHE, follow instructions at CONTRIBUTING.md.
QUICHE is only supported on little-endian platforms.
QUICHE has binaries that can run on Linux platforms.
Follow the instructions to install Bazel.
sudo apt install libicu-dev clang lld cd <directory that will be the root of your quiche implmentation> git clone https://github.com/google/quiche.git cd quiche CC=clang bazel build -c opt //... ./bazel-bin/quiche/<target_name> <arguments>
There are several targets that can be built and then run. Full usage instructions are available using the --helpfull flag on any binary.
Usage: quic_packet_printer server|client <hex dump of packet>
Usage: crypto_message_printer_bin <hex of message>
Usage: quic_client <URL>
quic_server: listens forever on --port (default 6121) until halted via ctrl-c.
masque_client: tunnels to a URL via an identified proxy (See RFC 9298).
Usage: masque_client [options] <proxy-url> <urls>
Usage: masque_server
web_transport_test_server: a server that clients can connect to via WebTransport.
moqt_relay: a relay for the Media Over QUIC transport for publishers and subscribers can connect to.
Usage: moqt_relay
Most log messages in QUICHE use the QUICHE_DLOG macro. In standalone quiche, these all either go to stderr, or are suppressed, based on the --stderrthreshold flag.
To send INFO level log messages to a file, you would therefore invoke
<binary> <args> > <logfile> 2>&1
Use the --helpfull flag for more.