Proxygen is Facebook's collection of C++ HTTP libraries designed to provide core HTTP abstractions used internally at Facebook for building HTTP servers, proxies, and clients. The project is written in C++ and focuses on delivering simple, performant, and modern HTTP functionality. The framework supports multiple HTTP protocol versions including HTTP/1.1, SPDY/3, SPDY/3.1, HTTP/2, and HTTP/3, with HTTP/3 support built on top of Facebook's mvfst library for IETF QUIC transport implementation.
The repository is organized into several key directories that reflect its layered architecture. The proxygen/lib/ directory contains core networking abstractions, with proxygen/lib/http/ housing HTTP-specific code including HTTP/2 and HTTP/3 implementations. Connection management and server code reside in proxygen/lib/services/, while proxygen/lib/utils/ provides miscellaneous helper utilities. The proxygen/httpserver/ directory wraps the lower-level library code to enable developers to build simple C++ HTTP servers, and this is the recommended approach for most users who do not require direct access to lower-level abstractions.
The central architectural components in proxygen/lib are the session, codec, transaction, and handler. When bytes arrive from the network, the HTTPCodec within HTTPSession parses them into higher-level objects and associates them with transaction identifiers. HTTPSession maintains the mapping between transaction identifiers and HTTPTransaction objects, with each HTTP request/response pair receiving its own HTTPTransaction. These transactions forward calls to handler objects implementing HTTPTransaction::Handler, which contain the business logic. The same handler and transaction interfaces work for both creating requests and handling responses, providing a unified API for client and server use cases.
The higher-level httpserver APIs provide HTTPServer, RequestHandlerFactory, and RequestHandler components. An HTTPServer accepts configuration and a RequestHandlerFactory, spawning a RequestHandler for each incoming HTTP request. Users implement RequestHandler subclasses and use the inherited downstream_ member to send responses.
Installation is straightforward through the provided build.sh script, which retrieves and builds all dependencies and proxygen itself. The project requires at least 3 GB of memory to compile and has been tested on Ubuntu 18.04 and Mac OSX, though it likely works on other platforms. Proxygen is also available through the vcpkg package manager, maintained by Microsoft team members and community contributors.
The repository includes several sample implementations demonstrating different use cases: an echo server, an HTTP/2 server with push support, a static file server, a forward proxy, and a curl-like HTTP client. These samples provide practical starting points for developers building on proxygen.
According to GitGenius activity tracking, the repository shows median issue and pull request response latency of 34.9 hours across 49 tracked items, with the most active labels being build (7 occurrences), enhancement (4), and question (3). The primary contributors tracked include afrind with 80 events, SteveSelva with 22 events, and hanidamlaj with 13 events. The repository shares overlapping contributors with llvm/llvm-project, ggml-org/llama.cpp, and rust-lang/rust, indicating cross-project collaboration within the broader systems programming community.