New Lib "Beast", HTTP + WebSocket protocols

"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: http::message: - class template modeling the HTTP message with customization points to satisfy even the most tough-minded reviewer. http::read http::write http::async_read http::async_write - Free functions to easily send and receive HTTP messages. Modeled to work exactly like boost::asio free functions. Role-agnostic, build clients or servers! websocket::stream - class template wrapping any asio sync or async stream. Implements the WebSocket protocol including the initial handshake. Examples: - websocket echo servers - HTTP servers for simple websites (no cgi) "I've heard enough, show me example code!" http://vinniefalco.github.io/beast/beast/intro/example.html Main page, with links to GitHub repository, HTML documentation and benchmarks: http://vinniefalco.github.io/ Feedback welcome, the author checks email and Issues on the GitHub repository. This project has been submitted to the Boost incubator.

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@gmail.com> 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:
participants (2)
-
David Stone
-
Vinnie Falco