Subject: [boost] Boost.HTTPKit, a new library from the makers of Beast!
From: Vinnie Falco (vinnie.falco_at_[hidden])
Date: 2017-10-04 15:22:28
During the formal review of Beast the desire was expressed to have
parsing and serialization available independently of Asio.
Unfortunately the obstacles to this are the concrete functions and
types required for interoperability with the buffer sequence concepts
defined in Asio.
I have drawn up a solution to this problem which involves creating two
brand new libraries.
The first new library is called Boost.Buffers, and I described it
partially in an earlier list posting. This library will contain copies
of just the header files from Asio needed to implement the buffer
sequence concepts. A preprocessor switch will allow users of
Boost.Buffers to decide whether to use the copies of the headers, or
to just include the Asio headers directly:
If an author wants to develop a library which uses just the buffer
sequence concepts from Asio, then instead of writing:
they will instead write:
in header files, and in their build scripts set:
#define BOOST_NET_BUFFER_NO_ASIO 1
This way, their tests and example programs will use the copies of the
asio headers found in the Boost.Buffers libraries and everything will
work. Boost.Asio will not be a dependency.
However, if a consumer of that library wants to also use Boost.Asio,
they can do so by just not setting the macro in their build scripts
(or explicitly setting it to 0).
Now that we have a way to write a library that uses Asio buffer
concepts without depending on all of Asio, we can move the Beast
dynamic buffer implementations and buffer adapters into the
Boost.Buffers will contain these public includes:
Boost.Buffers would have dependencies on these Boost libraries:
Beast will then be modified to take a dependency on Boost.Buffers to
have access to all the buffer adapters and dynamic buffer
Now that we have a new library which offers Asio buffer concepts and
Beast's collection of useful dynamic buffers and buffer adapters, we
can extract the HTTP parsing and serialization algorithms from Beast
to form a new library:
Boost.HTTPKit will contain these public includes:
Boost.HTTPKit would have dependencies on these Boost libraries:
This new library provides serialization and parsing of HTTP/1 messages
to and from Asio buffer sequences, without requiring the full
Boost.Asio dependency. The library also provides Beast's universal
HTTP message container.
Beast will be modified to take an additional dependency on Boost.HTTPKit.
This solution satisfies long-stated needs of users to have HTTP
parsing and serialization without Boost.Asio.
However, there is one problem and that is the documentation. All of
Beast's documentation related to buffer-oriented parsing and
serialization, message containers, Body types, Fields concept, buffer
sequences, and dynamic buffers will now be moved into two other
libraries. This leaves the Beast documentation objectively worse off
for users, as it is impossible to cross-link to other library
documentation from inside a Javadoc comment extracted by Doxygen. I
would like to hear ideas for how to smooth this out.
How does the community feel about:
* Boost.Buffers as a solution to accessing buffer concepts without Asio?
* Boost.Buffers offering Beast's buffer sequence adapters and dynamic buffers?
* Boost.HTTPKit depending on Boost.Buffers?
* Boost.HTTPKit offering serialization and parsing without Asio?
Any feedback is appreciated
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk