forked from boostorg/beast
New buffer sequence classes are provided to allow full
control over the serialization of chunk-encoded message
payloads:
* chunk_header
A ConstBufferSequence representing the chunk header.
It includes a hexadecimal-encoded size, an optional
set of chunk extensions, and the trailing CRLF
required to denote the end of the chunk header.
This allows the caller to manually serialize the chunk
body in one or more calls to a stream output function.
The caller must also output an object of type `chunk_crlf`
to the stream to indicate the end of the chunk body.
* chunk_crlf
A small ConstBufferSequence that simply represents
the two character sequence "\r\n" (CRLF). This is needed
for the case where the caller wants to output a chunk
body as a series of buffers (i.e. "chunking a chunk").
* chunk_body
A ConstBufferSequence representing a complete chunk.
This includes the size, an optional set of chunk extensions,
a caller provided buffer containing the body, and the
required CRLF that follows.
* chunk_final
A ConstBufferSequence representing a final chunk. It
includes an optional set of caller-provided field trailers
* chunk_extensions
A container for building a set of chunk extensions to use
during serialization. The use of the container is optional,
callers may provide their own buffer containing a correctly
formatted set of chunk extensions, or they may use their
own convenience container which meets the requirements.
The basic_fields container is modified to allow construction
outside the context of a message. The container can be used
to provide trailers to `chunk_final`.
Actions Required:
* Remove references to ChunkDecorators. Use the new chunk-encoding
buffer sequences to manually produce a chunked payload body in
the case where control over the chunk-extensions and/or trailers
is required.
97 lines
3.6 KiB
Plaintext
97 lines
3.6 KiB
Plaintext
[/
|
|
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 Introduction]
|
|
|
|
Beast is a C++ header-only library serving as a foundation for writing
|
|
interoperable networking libraries by providing [*low-level HTTP/1,
|
|
WebSocket, and networking protocol] vocabulary types and algorithms
|
|
using the consistent asynchronous model of __Asio__.
|
|
|
|
This library is designed for:
|
|
|
|
* [*Symmetry:] Algorithms are role-agnostic; build clients, servers, or both.
|
|
|
|
* [*Ease of Use:] __Asio__ users will immediately understand Beast.
|
|
|
|
* [*Flexibility:] Users make the important decisions such as buffer or
|
|
thread management.
|
|
|
|
* [*Performance:] Build applications handling thousands of connections or more.
|
|
|
|
* [*Basis for Further Abstraction.] Components are well-suited for building upon.
|
|
|
|
Beast is not an HTTP client or HTTP server, but it can be used to build
|
|
those things.
|
|
|
|
[heading Motivation]
|
|
|
|
Beast empowers users to create their own libraries, clients, and servers
|
|
using HTTP/1 and WebSocket. Code will be easier and faster to implement,
|
|
understand, and maintain, because Beast takes care of the low-level
|
|
protocol details.
|
|
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 Requirements]
|
|
|
|
[important
|
|
This library is for programmers familiar with __Asio__. Users who
|
|
wish to use asynchronous interfaces should already know how to
|
|
create concurrent network programs using callbacks or coroutines.
|
|
]
|
|
|
|
Beast requires:
|
|
|
|
* [*C++11:] Robust support for most language features.
|
|
* [*Boost:] Beast only works with Boost, not stand-alone Asio
|
|
* [*OpenSSL:] Optional, for using TLS/Secure sockets.
|
|
|
|
Supported compilers: msvc-14+, gcc 4.8+, clang 3.6+
|
|
|
|
Sources are [*header-only]. To link a program using Beast successfully, add the
|
|
[@http://www.boost.org/libs/system/doc/reference.html Boost.System]
|
|
library to the list of linked libraries. If you use coroutines
|
|
you'll also need the
|
|
[@http://www.boost.org/libs/coroutine/doc/html/index.html Boost.Coroutine]
|
|
library. Please visit the
|
|
[@http://www.boost.org/doc/ Boost documentation]
|
|
for instructions on how to do this for your particular build system.
|
|
|
|
[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
|
|
[@https://github.com/chriskohlhoff Christopher Kohlhoff]
|
|
for his wonderful Asio library and the ideas in __N4588__ which power Beast.
|
|
|
|
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
|
|
contributed by
|
|
[@https://github.com/JoelKatz David Schwartz],
|
|
[@https://github.com/ximinez Edward Hennis],
|
|
[@https://github.com/howardhinnant Howard Hinnant],
|
|
[@https://github.com/miguelportilla Miguel Portilla],
|
|
[@https://github.com/nbougalis Nik Bougalis],
|
|
[@https://github.com/seelabs Scott Determan],
|
|
[@https://github.com/scottschurr Scott Schurr],
|
|
Many thanks to
|
|
[@https://github.com/K-ballo Agustín Bergé],
|
|
[@http://www.boost.org/users/people/glen_fernandes.html Glen Fernandes],
|
|
and
|
|
[@https://github.com/pdimov Peter Dimov]
|
|
for tirelessly answering questions on
|
|
[@https://cpplang.slack.com/ Cpplang-Slack].
|
|
|
|
[endsect]
|