[Beast] A new WebSocket implementation in C++/Boost.Asio

#1

“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:

websocket::stream

  • class template wrapping any asio sync or async stream. Implements the WebSocket protocol including the initial handshake.

http::message:

  • class template modeling the HTTP message with customization points to satisfy even the most tough-minded Boost 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!

Examples:

  • websocket echo servers
  • HTTP servers for simple websites (no cgi)

What’s cool about this library is that it exposes the HTTP implementation so you can use it as a building block. It adheres to Boost.Asio best practices and offers a lot of implementation flexibility while maintaining a very lean interface.

“I’ve heard enough, show me example code!”
http://vinniefalco.github.io/beast/beast/intro/example.html

Main page, with the source code and links to everything:
https://github.com/vinniefalco/Beast

Feedback welcome, the author checks email and Issues on the GitHub repository. This project has been submitted to the Boost incubator.

0 Likes