Boost.Beast provides low-level HTTP/1 and WebSocket vocabulary types and algorithms on top of Boost.Asio. C++ developers use it to build clients, servers, or both with asynchronous I/O.
Overview
Beast is a header-only C++11 library from the Boost project that supplies protocol-level types and algorithms for HTTP/1 and WebSocket networking. It sits on Boost.Asio so code can follow the same asynchronous callback or coroutine style as other Asio programs.
The design emphasizes role-agnostic algorithms, reuse of buffers and threading choices by the application, and performance suitable for many concurrent connections. Components are intended as foundations for higher-level networking libraries rather than a turnkey server product.
OpenSSL is required for TLS examples and tests. Beast ships inside official Boost distributions and can also be developed from the Boost superproject with bjam or CMake workflows on Linux, Windows, and macOS when building examples.
Documentation covers streams, timeouts, rate limiting, layered streams, message containers, and worked client and server samples.
Key features
- HTTP/1 message types and algorithms
- WebSocket protocol support
- Boost.Asio asynchronous model
- Header-only C++11 library
- Client and server-oriented APIs
- TLS examples with OpenSSL
- Composable stream abstractions
- Extensive documentation and samples
Use cases
- Building custom HTTP servers in C++
- Implementing WebSocket clients or servers
- Networking code atop Boost.Asio
- Low-level protocol work before higher APIs