Files
boost_beast/doc/1_overview.qbk

133 lines
5.8 KiB
Plaintext
Raw Normal View History

2017-05-28 19:49:41 -07:00
[/
Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
]
[section:overview Introduction]
2017-06-04 17:25:55 -07:00
[important
Beast is a cross-platform, header-only C++11 library for low-level HTTP
and WebSocket protocol programming that uses the consistent network and
asynchronous model of __Asio__.
Beast is not an HTTP client or HTTP server, but it can be used to
build those things. The library is intended to be a foundation upon
which new libraries may be built. It is a goal that other architects
will create interoperable solutions on top of Beast. The provided
example programs shows how a client or server might be built.
]
The design of the library achieves these goals:
2017-05-28 19:49:41 -07:00
* [*Symmetry.] Interfaces are role-agnostic; the same interfaces can be
used to build clients, servers, or both.
* [*Ease of Use.] HTTP messages are modeled using a simple, expressive
container. Algorithms used to send and receive HTTP or WebSocket
messages are designed to make users already familiar with __Asio__
immediately comfortable using this library.
* [*Flexibility.] Interfaces do not mandate specific implementation
strategies; users make the important decisions such as buffer or
thread management.
* [*Performance.] The implementation performs competitively, making it
a realistic choice for building high performance network servers.
* [*Scalability.] Development of network applications that scale to
thousands of concurrent connections is possible with the implementation.
* [*Basis for Further Abstraction.] The interfaces facilitate the
development of other libraries that provide higher levels of abstraction.
[heading Requirements]
Beast requires:
* [*C++11.] A minimum of C++11 is needed.
* [*Boost.] Beast is built on Boost, especially Boost.Asio.
* [*OpenSSL.] If using TLS/Secure sockets (optional).
2017-06-04 17:25:55 -07:00
[note Supported compilers: msvc-14+, gcc 4.8+, clang 3.6+]
2017-05-28 19:49:41 -07:00
The library is [*header-only]. It is not necessary to add any .cpp files,
or to add commands to your build script for building Beast. To link your
program successfully, you'll need to add the Boost.System library to link
with. If you use coroutines you'll also need the Boost.Coroutine library.
Please visit the Boost documentation for instructions on how to do this for
your particular build system.
Beast does not compile using the stand-alone version of Asio, since it
relies on other Boost parts. There are no immediate plans to offer a
version that works with stand-alone Asio.
[heading Motivation]
2017-06-04 17:25:55 -07:00
There is a noted shortage of high quality C++ networking libraries,
2017-05-28 19:49:41 -07:00
especially for the HTTP and WebSocket protocols. The author theorizes
that previous attempts to build such libraries focused too much on end
user needs instead of applying principles of computer science to solve
the problem more formally. Another factor is that there no current
standardized interface for networking. This may change soon; with the
the introduction of the Networking Technical Specification (__N4588__),
a uniform interface for networking is on track to become standardized.
This technical specification is modeled closely after Boost.Asio.
Beast is built on Boost.Asio, with plans to adapt it to the networking
interfaces which become part of the C++ Standard.
The HTTP and WebSocket protocols drive most of the World Wide Web. Every
web browser implements these protocols to load webpages and to enable
client side programs (often written in JavaScript) to communicate
interactively. C++ benefits greatly from having a standardized
implementation of these protocols.
[heading Audience]
Beast is for network programmers who have some familiarity with __Asio__.
In particular, users who wish to write asynchronous programs with Beast
should already have knowledge and experience with Asio's asynchronous
model and style of asynchronous programming using callbacks or coroutines.
The protocol interfaces are low level. There are no out of the box solutions
for implementing clients or servers. For example, users must provide their
own code to make connections, handle timeouts, reconnect a dropped connection,
accept incoming connections, or manage connection resources on a server.
The HTTP interfaces provide functionality only for modelling HTTP
messages and serializing or parsing them on streams, including TCP/IP
sockets or OpenSSL streams. Higher level functions such as Basic
Authentication, mime/multipart encoding, cookies, automatic handling
of redirects, gzipped transfer encodings, caching, or proxying (to name
a few) are not directly provided, but nothing stops users from creating
these features using Beast's HTTP message types.
[heading Credits]
Boost.Asio is the inspiration behind which all of the interfaces and
implementation strategies are built. Some parts of the documentation are
written to closely resemble the wording and presentation of Boost.Asio
documentation. Credit goes to Christopher Kohlhoff for the wonderful
Asio library and the ideas upon which Beast is built.
2017-06-04 17:25:55 -07:00
Beast would not be possible without the support of
[@https://www.ripple.com Ripple]
during the library's early development, or the ideas, time and patience
2017-05-28 19:49:41 -07:00
contributed by
2017-06-04 17:25:55 -07:00
[@https://github.com/JoelKatz David Schwartz],
[@https://github.com/ximinez Edward Hennis],
2017-05-28 19:49:41 -07:00
[@https://github.com/howardhinnant Howard Hinnant],
2017-06-04 17:25:55 -07:00
[@https://github.com/miguelportilla Miguel Portilla],
[@https://github.com/nbougalis Nik Bougalis],
[@https://github.com/seelabs Scott Determan],
[@https://github.com/scottschurr],
Many thanks to
[@https://github.com/K-ballo Agustín Bergé],
2017-06-03 18:40:28 -07:00
[@http://www.boost.org/users/people/glen_fernandes.html Glen Fernandes],
2017-05-28 19:49:41 -07:00
and
2017-06-04 17:25:55 -07:00
[https://github.com/pdimov Peter Dimov]
for tirelessly answering questions on
[@https://cpplang.slack.com/ Cpplang-Slack].
2017-05-28 19:49:41 -07:00
[endsect]