1 <img width="880" height = "80" alt = "Boost.Beast Title"
2 src="https://raw.githubusercontent.com/boostorg/beast/master/doc/images/readme2.png">
4 # HTTP and WebSocket built on Boost.Asio in C++11
6 Branch | Linux / Windows | Coverage | Documentation | Matrix |
7 ----------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|
8 [master](https://github.com/boostorg/beast/tree/master) | [![Build Status](https://drone.cpp.al/api/badges/boostorg/beast/status.svg?ref=refs/heads/master)](https://drone.cpp.al/boostorg/beast) | [![codecov](https://img.shields.io/codecov/c/github/boostorg/beast/master.svg)](https://codecov.io/gh/boostorg/beast/branch/master) | [![Documentation](https://img.shields.io/badge/documentation-master-brightgreen.svg)](http://www.boost.org/doc/libs/master/libs/beast/doc/html/index.html) | [![Matrix](https://img.shields.io/badge/matrix-master-brightgreen.svg)](http://www.boost.org/development/tests/master/developer/beast.html) |
9 [develop](https://github.com/boostorg/beast/tree/develop) | [![Build Status](https://drone.cpp.al/api/badges/boostorg/beast/status.svg?ref=refs/heads/develop)](https://drone.cpp.al/boostorg/beast) | [![codecov](https://img.shields.io/codecov/c/github/boostorg/beast/develop.svg)](https://codecov.io/gh/boostorg/beast/branch/develop) | [![Documentation](https://img.shields.io/badge/documentation-develop-brightgreen.svg)](https://www.boost.org/doc/libs/develop/libs/beast/index.html) | [![Matrix](https://img.shields.io/badge/matrix-develop-brightgreen.svg)](https://www.boost.org/development/tests/develop/developer/beast.html) |
13 - [Introduction](#introduction)
14 - [Appearances](#appearances)
15 - [Description](#description)
16 - [Requirements](#requirements)
17 - [Git Branches](#branches)
18 - [Building](#building)
22 - [Contributing](#contributing-we-need-your-help)
26 Beast is a C++ header-only library serving as a foundation for writing
27 interoperable networking libraries by providing **low-level HTTP/1,
28 WebSocket, and networking protocol** vocabulary types and algorithms
29 using the consistent asynchronous model of Boost.Asio.
31 This library is designed for:
33 * **Symmetry:** Algorithms are role-agnostic; build clients, servers, or both.
35 * **Ease of Use:** Boost.Asio users will immediately understand Beast.
37 * **Flexibility:** Users make the important decisions such as buffer or
40 * **Performance:** Build applications handling thousands of connections or more.
42 * **Basis for Further Abstraction.** Components are well-suited for building upon.
46 | <a href="https://github.com/vinniefalco/CppCon2018">CppCon 2018</a> | <a href="https://www.bishopfox.com/case_study/securing-beast/">Bishop Fox 2018</a> |
47 | ------------ | ------------ |
48 | <a href="https://www.youtube.com/watch?v=7FQwAjELMek"><img width="320" height = "180" alt="Beast" src="https://raw.githubusercontent.com/vinniefalco/CppCon2018/master/CppCon2018.png"></a> | <a href="https://youtu.be/4TtyYbGDAj0"><img width="320" height = "180" alt="Beast Security Review" src="https://raw.githubusercontent.com/vinniefalco/BeastAssets/master/BishopFox2018.png"></a> |
50 | <a href="https://github.com/vinniefalco/CppCon2018">CppCon 2017</a> | <a href="http://cppcast.com/2017/01/vinnie-falco/">CppCast 2017</a> | <a href="https://raw.githubusercontent.com/vinniefalco/BeastAssets/master/CppCon2016.pdf">CppCon 2016</a> |
51 | ------------ | ------------ | ----------- |
52 | <a href="https://www.youtube.com/watch?v=WsUnnYEKPnI"><img width="320" height = "180" alt="Beast" src="https://raw.githubusercontent.com/vinniefalco/CppCon2017/master/CppCon2017.png"></a> | <a href="http://cppcast.com/2017/01/vinnie-falco/"><img width="180" height="180" alt="Vinnie Falco" src="https://avatars1.githubusercontent.com/u/1503976?v=3&u=76c56d989ef4c09625256662eca2775df78a16ad&s=180"></a> | <a href="https://www.youtube.com/watch?v=uJZgRcvPFwI"><img width="320" height = "180" alt="Beast" src="https://raw.githubusercontent.com/vinniefalco/BeastAssets/master/CppCon2016.png"></a> |
56 This software is in its first official release. Interfaces
57 may change in response to user feedback. For recent changes
58 see the [CHANGELOG](CHANGELOG.md).
60 * [Official Site](https://github.com/boostorg/beast)
61 * [Documentation](https://www.boost.org/doc/libs/master/libs/beast/) (master branch)
62 * [Autobahn|Testsuite WebSocket Results](https://vinniefalco.github.io/boost/beast/reports/autobahn/index.html)
66 This library is for programmers familiar with Boost.Asio. Users
67 who wish to use asynchronous interfaces should already know how to
68 create concurrent network programs using callbacks or coroutines.
70 * **C++11:** Robust support for most language features.
71 * **Boost:** Boost.Asio and some other parts of Boost.
72 * **OpenSSL:** Required for using TLS/Secure sockets and examples/tests
74 When using Microsoft Visual C++, Visual Studio 2017 or later is required.
76 One of these components is required in order to build the tests and examples:
78 * Properly configured bjam/b2
79 * CMake 3.5.1 or later (Windows only)
83 Beast is header-only. To use it just add the necessary `#include` line
84 to your source files, like this:
86 #include <boost/beast.hpp>
89 If you use coroutines you'll need to link with the Boost.Coroutine
90 library. Please visit the Boost documentation for instructions
91 on how to do this for your particular build system.
95 To use the latest official release of Beast, simply obtain the latest
96 Boost distribution and follow the instructions for integrating it
97 into your development environment. If you wish to build the examples
98 and tests, or if you wish to preview upcoming changes and features,
99 it is suggested to clone the "Boost superproject" and work with Beast
100 "in-tree" (meaning, the libs/beast subdirectory of the superproject).
102 The official repository contains the following branches:
104 * [**master**](https://github.com/boostorg/beast/tree/master) This
105 holds the most recent snapshot with code that is known to be stable.
107 * [**develop**](https://github.com/boostorg/beast/tree/develop) This
108 holds the most recent snapshot. It may contain unstable code.
110 Each of these branches requires a corresponding Boost branch and
111 all of its subprojects. For example, if you wish to use the **master**
112 branch version of Beast, you should clone the Boost superproject,
113 switch to the **master** branch in the superproject and acquire
114 all the Boost libraries corresponding to that branch including Beast.
116 To clone the superproject locally, and switch into the main project's
119 git clone --recursive https://github.com/boostorg/boost.git
123 "bjam" is used to build Beast and the Boost libraries. On a non-Windows
124 system use this command to build bjam:
129 From a Windows command line, build bjam using this command:
134 ## Building tests and examples
135 Building tests and examples requires OpenSSL installed. If OpenSSL is installed
136 in a non-system location, you will need to copy the
137 [user-config.jam](tools/user-config.jam) file into your home directory and set
138 the `OPENSSL_ROOT` environment variable to the path that contains an installation
142 If installed into a system directory, OpenSSL will be automatically found and used.
144 sudo apt install libssl-dev
147 Replace `path` in the following code snippets with the path you installed vcpkg
148 to. Examples assume a 32-bit build, if you build a 64-bit version replace
149 `x32-windows` with `x64-windows` in the path.
150 - Using [vcpkg](https://github.com/Microsoft/vcpkg) and CMD:
152 vcpkg install openssl --triplet x32-windows
153 SET OPENSSL_ROOT=path\installed\x32-windows
156 - Using [vcpkg](https://github.com/Microsoft/vcpkg) and PowerShell:
158 vcpkg install openssl --triplet x32-windows
159 $env:OPENSSL_ROOT = "path\x32-windows"
162 - Using [vcpkg](https://github.com/Microsoft/vcpkg) and bash:
164 vcpkg.exe install openssl --triplet x32-windows
165 export OPENSSL_ROOT=path/x32-windows
169 Using [brew](https://github.com/Homebrew/brew):
172 export OPENSSL_ROOT=$(brew --prefix openssl)
173 # install bjam tool user specific configuration file to read OPENSSL_ROOT
174 # see https://www.bfgroup.xyz/b2/manual/release/index.html
175 cp ./libs/beast/tools/user-config.jam $HOME
178 Make sure the bjam tool (also called "b2") is available in the path
179 your shell uses to find executables. The Beast project is located in
180 "libs/beast" relative to the directory containing the Boot superproject.
181 To build the Beast tests, examples, and documentation use these commands:
183 export PATH=$PWD:$PATH
184 b2 -j2 libs/beast/test cxxstd=11 # bjam must be in your $PATH
185 b2 -j2 libs/beast/example cxxstd=11 # "-j2" means use two processors
186 b2 libs/beast/doc # Doxygen and Saxon are required for this
191 Additional instructions for configuring, using, and building libraries
192 in superproject may be found in the
193 [Boost Wiki](https://github.com/boostorg/boost/wiki/Getting-Started).
197 CMake may be used to generate a very nice Visual Studio solution and
198 a set of Visual Studio project files using these commands:
204 cmake .. # for 32-bit Windows builds, or
205 cmake -G"Visual Studio 15 2017 Win64" .. # for 64-bit Windows builds (VS2017)
208 The files in the repository are laid out thusly:
212 bin/ Create this to hold executables and project files
213 bin64/ Create this to hold 64-bit Windows executables and project files
214 doc/ Source code and scripts for the documentation
215 include/ Where the header files are located
216 example/ Self contained example programs
217 meta/ Metadata for Boost integration
218 test/ The unit tests for Beast
219 tools/ Scripts used for CI testing
224 These examples are complete, self-contained programs that you can build
225 and run yourself (they are in the `example` directory).
227 https://www.boost.org/doc/libs/develop/libs/beast/doc/html/beast/quick_start.html
231 Distributed under the Boost Software License, Version 1.0.
232 (See accompanying file [LICENSE_1_0.txt](LICENSE_1_0.txt) or copy at
233 https://www.boost.org/LICENSE_1_0.txt)
237 Please report issues or questions here:
238 https://github.com/boostorg/beast/issues
242 ## Contributing (We Need Your Help!)
244 If you would like to contribute to Beast and help us maintain high
245 quality, consider performing code reviews on active pull requests.
246 Any feedback from users and stakeholders, even simple questions about
247 how things work or why they were done a certain way, carries value
248 and can be used to improve the library. Code review provides these
252 * Documentation proof-reading
253 * Adjust interfaces to suit use-cases
256 You can look through the Closed pull requests to get an idea of how
257 reviews are performed. To give a code review just sign in with your
258 GitHub account and then add comments to any open pull requests below,
260 <p>https://github.com/boostorg/beast/pulls</p>
262 Here are some resources to learn more about
265 * <a href="https://blog.scottnonnenberg.com/top-ten-pull-request-review-mistakes/">Top 10 Pull Request Review Mistakes</a>
266 * <a href="https://static1.smartbear.co/smartbear/media/pdfs/best-kept-secrets-of-peer-code-review_redirected.pdf">Best Kept Secrets of Peer Code Review (pdf)</a>
267 * <a href="https://static1.smartbear.co/support/media/resources/cc/11_best_practices_for_peer_code_review_redirected.pdf">11 Best Practices for Peer Code Review (pdf)</a>
268 * <a href="http://www.evoketechnologies.com/blog/code-review-checklist-perform-effective-code-reviews/">Code Review Checklist – To Perform Effective Code Reviews</a>
269 * <a href="https://www.codeproject.com/Articles/524235/Codeplusreviewplusguidelines">Code review guidelines</a>
270 * <a href="https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md">C++ Core Guidelines</a>
271 * <a href="https://www.oreilly.com/library/view/c-coding-standards/0321113586/">C++ Coding Standards (Sutter & Andrescu)</a>
273 Beast thrives on code reviews and any sort of feedback from users and
274 stakeholders about its interfaces. Even if you just have questions,
275 asking them in the code review or in issues provides valuable information
276 that can be used to improve the library - do not hesitate, no question
277 is insignificant or unimportant!