Adds a README for //third_party/http2/adapter. The document as written thus far describes the motivation and history behind the `oghttp2` project. Still remaining: code pointers, design notes, advice for developers. PiperOrigin-RevId: 743177355
diff --git a/quiche/http2/README.md b/quiche/http2/README.md new file mode 100644 index 0000000..c20b991 --- /dev/null +++ b/quiche/http2/README.md
@@ -0,0 +1,62 @@ +# HTTP/2 + +This directory contains C++ code implementing +[the HTTP/2 protocol](https://www.rfc-editor.org/rfc/rfc9113.html). + +Much of this code was written originally as a collaboration between the +[Chromium networking](https://www.chromium.org/developers/design-documents/network-stack/) +and +[Google Front End](https://cloud.google.com/docs/security/infrastructure/design#google-frontend-service) +teams while developing the experimental SPDY protocol. SPDY was later +standardized as HTTP/2. + +## `http2/adapter/` + +This subdirectory contains general purpose HTTP/2 protocol handling libraries. +The `oghttp2_adapter` library can be used in combination with an event loop, a +TLS library, and a socket library to make a complete HTTP/2 client or server. + +## `http2/core/` + +This subdirectory contains core utilities, including constants, data structures, +and some common entry points that can be used to parse and serialize HTTP/2 +protocol elements. + +## `http2/decoder` + +This subdirectory contains a decoder for the HTTP/2 wire format, written from +scratch by James Synge. This decoder is used by Chromium-based browsers, the +Google Front End reverse-proxy, and Envoy-based proxies. + +## `http2/hpack` + +This subdirectory contains a decoder and encoder for the +[HPACK](https://datatracker.ietf.org/doc/html/rfc7541) compression algorithm + +## `http2/test_tools` + +This subdirectory contains test utilities that facilitate writing unit tests for +code in the other subdirectories. + +## Contributors + +Some people who have contributed to this codebase include: + +* Alyssa Wilk +* Antonio Vicente +* Bence Beky +* Biren Roy +* Dan Zhang +* Daniel Hollingshead +* Dianna Hu +* Hasan Khalil +* James Synge +* John Graettinger +* Michaela LaVan +* Mike Belshe +* Mike Warres +* Robbie Shade +* Roberto Peon +* Ryan Hamilton +* Victor Vasiliev +* Yang Song
diff --git a/quiche/http2/adapter/README.md b/quiche/http2/adapter/README.md new file mode 100644 index 0000000..d4ef4a4 --- /dev/null +++ b/quiche/http2/adapter/README.md
@@ -0,0 +1,67 @@ +# `oghttp2`: a general purpose HTTP/2 library + +[TOC] + +## Overview + +The code in this directory implements the HTTP/2 internet protocol as specified +in [RFC 9113](https://www.rfc-editor.org/rfc/rfc9113.html). + +You will need the following additional pieces of code in order to build a +functioning client or server: + +* an event loop, like [`libevent`](https://libevent.org/) or + [`libuv`](https://libuv.org/); +* a TLS library, like [OpenSSL](https://www.openssl.org/); and +* application logic, to generate HTTP headers and bodies for the requests you + want to send, or the responses you want to serve. + +### Motivation + +Back in 2018, the open source [Envoy proxy](https://github.com/envoyproxy/envoy) +community [discovered](https://github.com/envoyproxy/envoy/issues/5155) that the +[`http-parser`](https://github.com/nodejs/http-parser) HTTP/1.1 codec library in +use at the time was no longer actively maintained. While working to resolve this +issue, Google engineers evaluated several HTTP/1 codec libraries as potential +replacements. After much consideration, we decided to release the Google HTTP/1 +codec library (Balsa) as part of the [QUICHE](https://github.com/google/quiche) +open source project. + +At this point, the QUICHE project provided open source implementations of HTTP/1 +and HTTP/3, but not HTTP/2. We were motivated in part by this glaring omission, +but also by the desire to provide a modern, readable C++ implementation for use +by Envoy and other future projects. + +### History + +We reused some existing open source code when building the `oghttp2` library. As +part of the [SPDY](https://www.chromium.org/spdy/spdy-whitepaper/) project, +developers on the Chromium project worked with other Google engineers to invent +a new multiplexed transport for HTTP. As the project evolved over time, those +engineers built several shared utilities, many of which survive to the present +day. + +These utilities are incorporated wholesale into `oghttp2`: + +* a wire format encoder, in `http2/core/spdy_framer.h`; +* a wire format decoder, in `http2/decoder/http2_frame_decoder.h`; +* a HPACK encoder, in `http2/hpack/hpack_encoder.h`; and +* a HPACK decoder, in `http2/hpack/hpack_decoder_adapter.h`. + +Given that part of our motivation for the `oghttp2` project was the needs of the +Envoy open source project, the first piece that we built was a C++ API around +the existing HTTP/2 library that Envoy used at that time: +[`nghttp2`](https://nghttp2.org/). This API started as an "adapter" layer +between Envoy's notion of a codec and what the `nghttp2` library provided, which +is why `oghttp2` is located in `http2/adapter`. + +We would like to thank the `nghttp2` project for providing a straightforward C +API that we could build on. + +## Code Overview + +### Common Types + +### Design + +### Adapter Implementations