|
Boost : |
Subject: Re: [boost] New Lib "Beast", HTTP + WebSocket protocols
From: Vinnie Falco (vinnie.falco_at_[hidden])
Date: 2016-04-28 19:46:48
The authors of Boost.Http and Beast (VinÃcius dos Santos Oliveira and
Vinnie Falco respectively) held a 4 hour summit on Thursday April 28,
discussing the two projects on Google Hangout/Skype, with a
simultaneous live-coding window (hosted for free by
http://coderpad.io).
The discussion began with defining the role of Beast. Based on
feedback from IRC and VinÃcius, I realized that Beast is very much a
low level library and does not try to satisfy end users with
convenient one liners for doing common tasks like fetching a webpage
from a server. We formalized that role for Beast, defining these areas
of responsibility for the library:
1. Define a universal HTTP message model
2. Parse messages in HTTP/1.* wire format
3. Read HTTP/1.* messages from a socket/stream
4. Serialize messages in HTTP/1.* wire format
5. Write HTTP/1.* message to a socket/stream
While these interfaces are essential building blocks they don't
directly satisfy the use-cases that most users want. Boost.Http aims
to fill those gaps by providing higher level abstractions. For
example, its http server offering manages common tasks such as setting
ETag on replies, serving files asynchronously, and managing connection
state.
I introduced a new class, beast::http::basic_parser which is a
header-only HTTP parser in the style of the nodejs parser written in C
commonly used by these libraries, but updated to use C++ features like
CRTP and templating. This now-complete implementation allows existing
and new libraries to migrate off the nodejs parser and become
header-only offerings.
Discussions then moved to refinement of the BasicParser concept and
its role in deserializing messages. We discussed the Body concept and
its associated types permitting customization of serialization and
deserialization strategies.
Finally we talked about what a collaboration might look like. We
discussed the pros and cons of merging the projects, its effect on
development, documentation, tests, and the disposition of the
WebSocket portion of Beast. The conclusion for now is to explore Beast
integration in Boost.Http, where Beast's role is to provide the low
level operations for serializing, deserializing HTTP/1.1 to sockets
and streams. Beast could be incorporated as a submodule for now, with
tighter integration choices considered later.
We ended with a few calls to action:
* Changes to Beast message interfaces to facilitate integration
* Explore integration of beast::http::basic_parser into Boost.Http
Thanks
On Fri, Apr 22, 2016 at 1:01 PM, Vinnie Falco <vinnie.falco_at_[hidden]> wrote:
> "Beast"
>
> This is a new library that implements the HTTP and WebSocket protocols
> using Boost.Asio and a few other Boost tidbits. Here's a quick
> synopsis of what's in it:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk