...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
The implementations were originally driven by business needs of cryptocurrency server applications (e.g. rippled), written in C++. These needs were not met by existing solutions so Beast was written from scratch as a solution. Beast's design philosophy avoids flaws exhibited by other libraries:
Beast uses the DynamicBuffer
concept presented in the Networking
TS, and relies heavily on the ConstBufferSequence
and MutableBufferSequence
concepts for passing buffers to functions. The authors have found the dynamic
buffer and buffer sequence interfaces to be optimal for interacting with Asio,
and for other tasks such as incremental parsing of data in buffers (for example,
parsing websocket frames stored in a static_buffer
).
During the development of Beast the authors have studied other software packages and in particular the comments left during the Boost Review process of other packages offering similar functionality. In this section and the FAQs that follow we attempt to answer those questions that are also applicable to Beast.
For HTTP we model the message to maximize flexibility of implementation strategies
while allowing familiar verbs such as read
and write
.
The HTTP interface is further driven by the needs of the WebSocket module,
as a WebSocket session requires a HTTP Upgrade handshake exchange at the start.
Other design goals:
The following video presentation was delivered at CppCon in 2016. It provides a light introduction to some of the earliest interfaces of Beast (which have since changed).