├── doc ├── .gitignore ├── images │ ├── message.png │ └── readme2.png └── qbk │ ├── 07_concepts │ ├── BufferSequence.qbk │ └── _concepts.qbk │ ├── index.xml │ ├── version.qbk │ └── 01_intro │ └── 1b_autobahn.qbk ├── test ├── cmake_test │ └── main.cpp ├── fuzz │ ├── seeds.tar │ ├── http_request.cpp │ └── http_response.cpp ├── extras │ ├── README.md │ └── include │ │ └── boost │ │ └── beast │ │ └── test │ │ └── sig_wait.hpp ├── beast │ ├── http │ │ ├── fields_fwd.cpp │ │ ├── message_fwd.cpp │ │ ├── parser_fwd.cpp │ │ ├── empty_body_fwd.cpp │ │ ├── file_body_fwd.cpp │ │ ├── serializer_fwd.cpp │ │ ├── span_body_fwd.cpp │ │ ├── buffer_body_fwd.cpp │ │ ├── dynamic_body_fwd.cpp │ │ ├── string_body_fwd.cpp │ │ ├── vector_body_fwd.cpp │ │ ├── basic_file_body_fwd.cpp │ │ ├── message_generator_fwd.cpp │ │ ├── basic_dynamic_body_fwd.cpp │ │ ├── field_compiles.cpp │ │ ├── basic_file_body.cpp │ │ ├── basic_dynamic_body.cpp │ │ ├── empty_body.cpp │ │ ├── string_body.cpp │ │ ├── CMakeLists.txt │ │ └── vector_body.cpp │ ├── core │ │ ├── file.cpp │ │ ├── role.cpp │ │ ├── string.cpp │ │ ├── file_base.cpp │ │ ├── CMakeLists.txt │ │ ├── file_win32.cpp │ │ ├── file_posix.cpp │ │ ├── file_stdio.cpp │ │ ├── span.cpp │ │ ├── _detail_clamp.cpp │ │ └── buffers_to_string.cpp │ ├── ssl │ │ ├── ssl_stream.cpp │ │ ├── CMakeLists.txt │ │ └── Jamfile │ ├── websocket │ │ ├── option.cpp │ │ ├── stream_fwd.cpp │ │ ├── teardown.cpp │ │ ├── _detail_impl_base.cpp │ │ ├── stream_explicit.cpp │ │ └── CMakeLists.txt │ ├── _experimental │ │ ├── error.cpp │ │ ├── _test_detail_stream_state.cpp │ │ ├── Jamfile │ │ └── CMakeLists.txt │ ├── zlib │ │ ├── zlib.cpp │ │ ├── Jamfile │ │ └── CMakeLists.txt │ ├── core.cpp │ ├── http.cpp │ ├── ssl.cpp │ ├── zlib.cpp │ ├── version.cpp │ ├── websocket.cpp │ └── Jamfile ├── example │ ├── CMakeLists.txt │ ├── common │ │ ├── root_certificates.cpp │ │ ├── server_certificate.cpp │ │ ├── Jamfile │ │ └── CMakeLists.txt │ └── Jamfile ├── lib_beast.cpp ├── lib_asio.cpp ├── lib_asio_ssl.cpp ├── lib_test.cpp ├── bench │ ├── zlib │ │ ├── Jamfile │ │ └── CMakeLists.txt │ ├── wsload │ │ ├── Jamfile │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ ├── Jamfile │ ├── buffers │ │ ├── Jamfile │ │ └── CMakeLists.txt │ ├── utf8_checker │ │ ├── Jamfile │ │ └── CMakeLists.txt │ └── parser │ │ ├── Jamfile │ │ ├── CMakeLists.txt │ │ └── nodejs_parser.cpp ├── extern │ └── zlib-1.3.1 │ │ ├── inffast.h │ │ └── gzclose.c └── doc │ ├── snippets.hpp │ ├── websocket_common.ipp │ ├── snippets.ipp │ └── CMakeLists.txt ├── .gitignore ├── tools ├── retry.sh ├── user-config.jam └── valgrind.supp ├── cmake └── toolchains │ ├── clang.cmake │ ├── gcc.cmake │ ├── common.cmake │ └── msvc.cmake ├── .gitattributes ├── example ├── doc │ ├── Jamfile │ ├── CMakeLists.txt │ └── ssl │ │ ├── Jamfile │ │ └── CMakeLists.txt ├── http │ ├── Jamfile │ ├── CMakeLists.txt │ ├── client │ │ ├── async-local │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ │ ├── sync │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ │ ├── async │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ │ ├── methods │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ │ ├── awaitable │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ │ ├── crawl │ │ │ ├── Jamfile │ │ │ ├── urls_large_data.hpp │ │ │ └── CMakeLists.txt │ │ ├── body │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ │ ├── coro │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ │ ├── Jamfile │ │ ├── async-ssl │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ │ ├── sync-ssl │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ │ ├── awaitable-ssl │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ │ ├── coro-ssl │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ │ ├── async-ssl-system-executor │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ │ └── CMakeLists.txt │ └── server │ │ ├── async-local │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── fast │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── sync │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── async │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── small │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── stackless │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── awaitable │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── coro │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── flex │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── async-ssl │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── sync-ssl │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── Jamfile │ │ ├── stackless-ssl │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── coro-ssl │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ └── CMakeLists.txt ├── websocket │ ├── Jamfile │ ├── CMakeLists.txt │ ├── client │ │ ├── async-local │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ │ ├── sync │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ │ ├── async │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ │ ├── awaitable │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ │ ├── coro │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ │ ├── Jamfile │ │ ├── CMakeLists.txt │ │ ├── async-ssl │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ │ ├── sync-ssl │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ │ ├── coro-ssl │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ │ └── async-ssl-system-executor │ │ │ ├── Jamfile │ │ │ └── CMakeLists.txt │ └── server │ │ ├── async-local │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── sync │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── async │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── awaitable │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── stackless │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── coro │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── fast │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── chat-multi │ │ ├── Jamfile │ │ ├── net.hpp │ │ ├── beast.hpp │ │ └── CMakeLists.txt │ │ ├── Jamfile │ │ ├── async-ssl │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── sync-ssl │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── stackless-ssl │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ ├── coro-ssl │ │ ├── Jamfile │ │ └── CMakeLists.txt │ │ └── CMakeLists.txt ├── echo-op │ ├── Jamfile │ └── CMakeLists.txt ├── advanced │ ├── Jamfile │ ├── server │ │ ├── Jamfile │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ ├── server-flex │ │ ├── Jamfile │ │ └── CMakeLists.txt │ └── server-flex-awaitable │ │ ├── Jamfile │ │ └── CMakeLists.txt ├── CMakeLists.txt └── Jamfile ├── meta └── libraries.json ├── include └── boost │ ├── beast │ ├── ssl.hpp │ ├── http │ │ ├── buffer_body_fwd.hpp │ │ ├── empty_body_fwd.hpp │ │ ├── span_body_fwd.hpp │ │ ├── message_generator_fwd.hpp │ │ ├── basic_file_body_fwd.hpp │ │ ├── basic_dynamic_body_fwd.hpp │ │ ├── vector_body_fwd.hpp │ │ ├── fields_fwd.hpp │ │ ├── file_body_fwd.hpp │ │ ├── string_body_fwd.hpp │ │ ├── impl │ │ │ └── error.hpp │ │ ├── dynamic_body_fwd.hpp │ │ ├── serializer_fwd.hpp │ │ ├── dynamic_body.hpp │ │ ├── parser_fwd.hpp │ │ ├── file_body.hpp │ │ └── message_fwd.hpp │ ├── zlib.hpp │ ├── core │ │ ├── span.hpp │ │ ├── tcp_stream.hpp │ │ ├── detail │ │ │ ├── service_base.hpp │ │ │ ├── string.hpp │ │ │ └── allocator.hpp │ │ ├── impl │ │ │ ├── error.hpp │ │ │ ├── flat_static_buffer.hpp │ │ │ └── static_buffer.hpp │ │ ├── string_type.hpp │ │ ├── static_string.hpp │ │ └── file.hpp │ ├── websocket.hpp │ ├── websocket │ │ ├── stream_fwd.hpp │ │ ├── detail │ │ │ └── type_traits.hpp │ │ └── impl │ │ │ ├── error.hpp │ │ │ └── rfc6455.hpp │ ├── version.hpp │ └── _experimental │ │ └── test │ │ ├── impl │ │ └── error.hpp │ │ └── error.hpp │ └── beast.hpp ├── index.html ├── .codecov.yml └── .github └── ISSUE_TEMPLATE.md /doc/.gitignore: -------------------------------------------------------------------------------- 1 | html 2 | temp 3 | out.txt 4 | qbk/reference.qbk 5 | -------------------------------------------------------------------------------- /test/cmake_test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /test/fuzz/seeds.tar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/beast/HEAD/test/fuzz/seeds.tar -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | bin64/ 3 | 4 | # Because of CMake and VS2017 5 | Win32/ 6 | x64/ 7 | 8 | -------------------------------------------------------------------------------- /doc/images/message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/beast/HEAD/doc/images/message.png -------------------------------------------------------------------------------- /doc/images/readme2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boostorg/beast/HEAD/doc/images/readme2.png -------------------------------------------------------------------------------- /test/extras/README.md: -------------------------------------------------------------------------------- 1 | # Extras 2 | 3 | These are not part of the official public Beast interface but they are used by the tests and some third party programs. 4 | -------------------------------------------------------------------------------- /tools/retry.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | for i in {1..3} 4 | do 5 | $1 "${@:2:99}" && exit 0; 6 | export BEAST_RETRY="true" 7 | done 8 | 9 | exit 1 10 | -------------------------------------------------------------------------------- /cmake/toolchains/clang.cmake: -------------------------------------------------------------------------------- 1 | # Include gcc options. 2 | include(${CMAKE_CURRENT_LIST_DIR}/gcc.cmake) 3 | 4 | # Compiler options. 5 | add_compile_options(-Wrange-loop-analysis) 6 | -------------------------------------------------------------------------------- /cmake/toolchains/gcc.cmake: -------------------------------------------------------------------------------- 1 | # Include common options. 2 | include(${CMAKE_CURRENT_LIST_DIR}/common.cmake) 3 | 4 | # Compiler options. 5 | add_compile_options(-Wall -Wextra -Wpedantic) 6 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set default behaviour, in case users don't have core.autocrlf set. 2 | * text=auto 3 | 4 | # Github 5 | .md text eol=lf 6 | 7 | # Visual Studio 8 | *.sln text eol=crlf 9 | *.vcproj text eol=crlf 10 | *.vcxproj text eol=crlf 11 | *.props text eol=crlf 12 | *.filters text eol=crlf 13 | -------------------------------------------------------------------------------- /example/doc/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2025 Mohammad Nejati 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | build-project ssl ; 11 | -------------------------------------------------------------------------------- /example/doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2025 Mohammad Nejati 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | if (OPENSSL_FOUND) 11 | add_subdirectory(ssl) 12 | endif () 13 | -------------------------------------------------------------------------------- /example/http/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | build-project client ; 11 | build-project server ; 12 | -------------------------------------------------------------------------------- /tools/user-config.jam: -------------------------------------------------------------------------------- 1 | # Used on CI 2 | 3 | import os ; 4 | 5 | local OPENSSL_ROOT = [ os.environ OPENSSL_ROOT ] ; 6 | 7 | project 8 | : requirements 9 | $(OPENSSL_ROOT)/include 10 | debug:$(OPENSSL_ROOT)/lib 11 | windowsdebug:$(OPENSSL_ROOT)/debug/lib 12 | release:$(OPENSSL_ROOT)/lib 13 | ; 14 | -------------------------------------------------------------------------------- /example/websocket/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | build-project client ; 11 | build-project server ; 12 | -------------------------------------------------------------------------------- /example/http/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | add_subdirectory(client) 11 | add_subdirectory(server) 12 | -------------------------------------------------------------------------------- /example/websocket/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | add_subdirectory(client) 11 | add_subdirectory(server) 12 | -------------------------------------------------------------------------------- /test/beast/http/fields_fwd.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/http/message_fwd.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/http/parser_fwd.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/example/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_subdirectory(common) 12 | -------------------------------------------------------------------------------- /test/beast/http/empty_body_fwd.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/http/file_body_fwd.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/http/serializer_fwd.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/http/span_body_fwd.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/http/buffer_body_fwd.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/http/dynamic_body_fwd.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/http/string_body_fwd.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/http/vector_body_fwd.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/http/basic_file_body_fwd.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/http/message_generator_fwd.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/lib_beast.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // This file is used to build a static library 11 | 12 | #include 13 | -------------------------------------------------------------------------------- /test/beast/core/file.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/core/role.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/http/basic_dynamic_body_fwd.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/lib_asio.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // This file is used to build a static library 11 | 12 | #include 13 | -------------------------------------------------------------------------------- /test/beast/core/string.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/core/file_base.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/http/field_compiles.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/ssl/ssl_stream.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/lib_asio_ssl.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // This file is used to build a static library 11 | 12 | #include 13 | -------------------------------------------------------------------------------- /test/beast/websocket/option.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/http/basic_file_body.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/websocket/stream_fwd.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/websocket/teardown.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/_experimental/error.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/lib_test.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // This file is used to build a static library 11 | 12 | #include 13 | 14 | -------------------------------------------------------------------------------- /test/beast/http/basic_dynamic_body.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /test/beast/zlib/zlib.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Make sure symbols don't conflict with ZLib 11 | #include "zlib-1.3.1/zlib.h" 12 | #include 13 | -------------------------------------------------------------------------------- /test/example/common/root_certificates.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include "example/common/root_certificates.hpp" 12 | -------------------------------------------------------------------------------- /test/example/common/server_certificate.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include "example/common/server_certificate.hpp" 12 | -------------------------------------------------------------------------------- /example/echo-op/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe echo-op : 11 | echo_op.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /test/beast/websocket/_detail_impl_base.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | -------------------------------------------------------------------------------- /example/advanced/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | build-project server ; 11 | 12 | # SSL 13 | build-project server-flex ; 14 | 15 | # C++20 16 | build-project server-flex-awaitable ; 17 | -------------------------------------------------------------------------------- /example/http/client/async-local/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2025 Mohammad Nejati 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe http-client-async-local : 11 | http_client_async_local.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /example/http/server/async-local/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2025 Mohammad Nejati 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe http-server-async-local : 11 | http_server_async_local.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /meta/libraries.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "beast", 3 | "name": "Beast", 4 | "authors": [ 5 | "Vinnie Falco" 6 | ], 7 | "description": "Portable HTTP, WebSocket, and network operations using only C++11 and Boost.Asio", 8 | "category": [ 9 | "Concurrent", 10 | "IO" 11 | ], 12 | "maintainers": [ 13 | "Vinnie Falco ", 14 | "Mohammad Nejati " 15 | ], 16 | "cxxstd": "11" 17 | } 18 | -------------------------------------------------------------------------------- /test/bench/zlib/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe bench-zlib : 11 | $(ZLIB_SOURCES) 12 | deflate_stream.cpp 13 | inflate_stream.cpp 14 | /boost/beast/test//lib-test 15 | ; 16 | -------------------------------------------------------------------------------- /test/extern/zlib-1.3.1/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start); 12 | -------------------------------------------------------------------------------- /example/advanced/server/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe advanced-server : 11 | advanced_server.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /example/doc/ssl/Jamfile: -------------------------------------------------------------------------------- 1 | import ac ; 2 | 3 | project 4 | : requirements 5 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 6 | ; 7 | 8 | exe doc-ssl-client : 9 | client.cpp 10 | : 11 | coverage:no 12 | ubasan:no 13 | ; 14 | 15 | exe doc-ssl-server : 16 | server.cpp 17 | : 18 | coverage:no 19 | ubasan:no 20 | ; 21 | -------------------------------------------------------------------------------- /example/http/client/sync/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe http-client-sync : 11 | http_client_sync.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /example/http/server/fast/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe http-server-fast : 11 | http_server_fast.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /example/http/server/sync/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe http-server-sync : 11 | http_server_sync.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /example/websocket/client/async-local/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2025 Mohammad Nejati 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe websocket-client-async-local : 11 | websocket_client_async_local.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /example/websocket/server/async-local/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2025 Mohammad Nejati 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe websocket-server-async-local : 11 | websocket_server_async_local.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /example/http/client/async/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe http-client-async : 11 | http_client_async.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /example/http/server/async/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe http-server-async : 11 | http_server_async.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /example/http/server/small/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe http-server-small : 11 | http_server_small.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /example/http/client/methods/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe http-client-methods : 11 | http_client_methods.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /test/bench/wsload/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe wsload : 11 | wsload.cpp 12 | ; 13 | 14 | explicit wsload ; 15 | 16 | alias run-tests : 17 | [ compile wsload.cpp : : wsload-compile ] 18 | ; 19 | -------------------------------------------------------------------------------- /example/http/client/awaitable/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe http-client-awaitable : 11 | http_client_awaitable.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /example/http/server/stackless/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe http-server-stackless : 11 | http_server_stackless.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /example/websocket/client/sync/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe websocket-client-sync : 11 | websocket_client_sync.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /example/websocket/server/sync/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe websocket-server-sync : 11 | websocket_server_sync.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /example/http/client/crawl/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe http-crawl : 11 | http_crawl.cpp 12 | urls_large_data.cpp 13 | : 14 | coverage:no 15 | ubasan:no 16 | ; 17 | -------------------------------------------------------------------------------- /example/websocket/client/async/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe websocket-client-async : 11 | websocket_client_async.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /example/websocket/server/async/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe websocket-server-async : 11 | websocket_server_async.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /example/websocket/client/awaitable/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe websocket-client-awaitable : 11 | websocket_client_awaitable.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /example/websocket/server/awaitable/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe websocket-server-awaitable : 11 | websocket_server_awaitable.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /example/websocket/server/stackless/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe websocket-server-stackless : 11 | websocket_server_stackless.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | ; 16 | -------------------------------------------------------------------------------- /example/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | find_package(OpenSSL) 11 | 12 | add_subdirectory(advanced) 13 | add_subdirectory(http) 14 | add_subdirectory(websocket) 15 | 16 | add_subdirectory(doc) 17 | 18 | add_subdirectory(echo-op) 19 | -------------------------------------------------------------------------------- /example/http/client/body/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe json_client : json_client.cpp 11 | : 12 | coverage:no 13 | ubasan:no 14 | /boost/json//boost_json/static 15 | ; 16 | -------------------------------------------------------------------------------- /example/http/server/awaitable/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe http-server-awaitable : 11 | http_server_awaitable.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | no 16 | ; 17 | -------------------------------------------------------------------------------- /test/bench/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_subdirectory(buffers) 12 | add_subdirectory(parser) 13 | add_subdirectory(utf8_checker) 14 | add_subdirectory(wsload) 15 | add_subdirectory(zlib) 16 | -------------------------------------------------------------------------------- /test/bench/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | alias run-tests : 11 | buffers//run-tests 12 | parser//run-tests 13 | wsload//run-tests 14 | utf8_checker//run-tests 15 | #zlib//run-tests # Not built, too slow 16 | ; 17 | -------------------------------------------------------------------------------- /include/boost/beast/ssl.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_SSL_HPP 11 | #define BOOST_BEAST_SSL_HPP 12 | 13 | #include 14 | 15 | #include 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /example/advanced/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_subdirectory(server) 12 | 13 | if (OPENSSL_FOUND) 14 | add_subdirectory(server-flex) 15 | add_subdirectory(server-flex-awaitable) 16 | endif () 17 | -------------------------------------------------------------------------------- /example/http/client/coro/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe http-client-coro : 11 | http_client_coro.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | /boost/context//boost_context 16 | ; 17 | -------------------------------------------------------------------------------- /example/http/server/coro/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe http-server-coro : 11 | http_server_coro.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | /boost/context//boost_context 16 | ; 17 | -------------------------------------------------------------------------------- /test/example/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | alias run-tests : 11 | common//run-tests 12 | ; 13 | 14 | alias fat-tests ; 15 | 16 | explicit fat-tests ; 17 | 18 | alias run-fat-tests : common//run-tests ; 19 | 20 | explicit run-fat-tests ; 21 | -------------------------------------------------------------------------------- /tools/valgrind.supp: -------------------------------------------------------------------------------- 1 | { 2 | zlib_fill_window_no_init 3 | Memcheck:Cond 4 | fun:fill_window 5 | } 6 | 7 | { 8 | zlib_deflate_fast 9 | Memcheck:Cond 10 | fun:deflate_fast 11 | } 12 | 13 | { 14 | Ignore OpenSSL malloc 15 | Memcheck:Leak 16 | fun:malloc 17 | fun:CRYPTO_malloc 18 | obj:*libcrypto* 19 | } 20 | { 21 | Ignore OpenSSL realloc 22 | Memcheck:Leak 23 | fun:realloc 24 | fun:CRYPTO_realloc 25 | obj:*libcrypto* 26 | } 27 | { 28 | OpenSSL Non-Purify 29 | Memcheck:Cond 30 | obj:*libcrypto* 31 | } 32 | -------------------------------------------------------------------------------- /test/beast/_experimental/_test_detail_stream_state.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2021 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // Copyright (c) 2021 Richard Hodges (hodges.r@gmail.com) 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | // Official repository: https://github.com/boostorg/beast 9 | // 10 | 11 | // Test that header file is self-contained. 12 | #include 13 | -------------------------------------------------------------------------------- /test/bench/buffers/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe bench-buffers : 11 | bench_buffers.cpp 12 | /boost/beast/test//lib-test 13 | ; 14 | 15 | explicit bench-buffers ; 16 | 17 | alias run-tests : 18 | [ compile bench_buffers.cpp ] 19 | ; 20 | -------------------------------------------------------------------------------- /example/websocket/client/coro/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe websocket-client-coro : 11 | websocket_client_coro.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | /boost/context//boost_context 16 | ; 17 | -------------------------------------------------------------------------------- /example/websocket/server/coro/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe websocket-server-coro : 11 | websocket_server_coro.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | /boost/context//boost_context 16 | ; 17 | -------------------------------------------------------------------------------- /example/websocket/server/fast/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe websocket-server-fast : 11 | websocket_server_fast.cpp 12 | : 13 | coverage:no 14 | ubasan:no 15 | /boost/context//boost_context 16 | ; 17 | -------------------------------------------------------------------------------- /doc/qbk/07_concepts/BufferSequence.qbk: -------------------------------------------------------------------------------- 1 | [/ 2 | Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | 4 | Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | Official repository: https://github.com/boostorg/beast 8 | ] 9 | 10 | [section:BufferSequence BufferSequence] 11 | 12 | A [*BufferSequence] is a type meeting either of the following requirements: 13 | 14 | * __ConstBufferSequence__ 15 | * __MutableBufferSequence__ 16 | 17 | [endsect] 18 | -------------------------------------------------------------------------------- /doc/qbk/index.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 |
13 | Index 14 | 15 |
16 | -------------------------------------------------------------------------------- /include/boost/beast/http/buffer_body_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_HTTP_BUFFER_BODY_FWD_HPP 11 | #define BOOST_BEAST_HTTP_BUFFER_BODY_FWD_HPP 12 | 13 | namespace boost { 14 | namespace beast { 15 | namespace http { 16 | 17 | struct buffer_body; 18 | 19 | } // http 20 | } // beast 21 | } // boost 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /include/boost/beast/http/empty_body_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_HTTP_EMPTY_BODY_FWD_HPP 11 | #define BOOST_BEAST_HTTP_EMPTY_BODY_FWD_HPP 12 | 13 | namespace boost { 14 | namespace beast { 15 | namespace http { 16 | 17 | struct empty_body; 18 | 19 | } // http 20 | } // beast 21 | } // boost 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /example/websocket/server/chat-multi/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe websocket-chat-multi : 11 | http_session.cpp 12 | listener.cpp 13 | main.cpp 14 | shared_state.cpp 15 | websocket_session.cpp 16 | : 17 | coverage:no 18 | ubasan:no 19 | ; 20 | -------------------------------------------------------------------------------- /test/bench/utf8_checker/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | exe bench-utf8-checker : bench_utf8_checker.cpp 11 | : requirements 12 | /boost/beast/test//lib-test 13 | ; 14 | 15 | explicit bench-utf8-checker ; 16 | 17 | alias run-tests : 18 | [ compile bench_utf8_checker.cpp ] 19 | ; 20 | -------------------------------------------------------------------------------- /include/boost/beast/http/span_body_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_HTTP_SPAN_BODY_FWD_HPP 11 | #define BOOST_BEAST_HTTP_SPAN_BODY_FWD_HPP 12 | 13 | namespace boost { 14 | namespace beast { 15 | namespace http { 16 | 17 | template 18 | struct span_body; 19 | 20 | } // http 21 | } // beast 22 | } // boost 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /example/http/client/crawl/urls_large_data.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_EXAMPLE_HTTP_CLIENT_CRAWL_URLS_LARGE_DATA_HPP 11 | #define BOOST_BEAST_EXAMPLE_HTTP_CLIENT_CRAWL_URLS_LARGE_DATA_HPP 12 | 13 | #include 14 | 15 | std::vector const& 16 | urls_large_data(); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /include/boost/beast/http/message_generator_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_HTTP_MESSAGE_GENERATOR_FWD_HPP 11 | #define BOOST_BEAST_HTTP_MESSAGE_GENERATOR_FWD_HPP 12 | 13 | namespace boost { 14 | namespace beast { 15 | namespace http { 16 | 17 | class message_generator; 18 | 19 | } // http 20 | } // beast 21 | } // boost 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /test/beast/core.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // If including Windows.h generates errors, it 11 | // means that min/max macros are being substituted. 12 | #ifdef _MSC_VER 13 | #define WIN32_LEAN_AND_MEAN 14 | #include 15 | #endif 16 | 17 | // Test that header file is self-contained. 18 | #include 19 | -------------------------------------------------------------------------------- /test/beast/http.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // If including Windows.h generates errors, it 11 | // means that min/max macros are being substituted. 12 | #ifdef _MSC_VER 13 | #define WIN32_LEAN_AND_MEAN 14 | #include 15 | #endif 16 | 17 | // Test that header file is self-contained. 18 | #include 19 | -------------------------------------------------------------------------------- /test/beast/ssl.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // If including Windows.h generates errors, it 11 | // means that min/max macros are being substituted. 12 | #ifdef _MSC_VER 13 | #define WIN32_LEAN_AND_MEAN 14 | #include 15 | #endif 16 | 17 | // Test that header file is self-contained. 18 | #include 19 | -------------------------------------------------------------------------------- /test/beast/zlib.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // If including Windows.h generates errors, it 11 | // means that min/max macros are being substituted. 12 | #ifdef _MSC_VER 13 | #define WIN32_LEAN_AND_MEAN 14 | #include 15 | #endif 16 | 17 | // Test that header file is self-contained. 18 | #include 19 | -------------------------------------------------------------------------------- /example/websocket/client/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | build-project async ; 11 | build-project async-local ; 12 | build-project awaitable ; 13 | build-project coro ; 14 | build-project sync ; 15 | 16 | # SSL 17 | build-project async-ssl ; 18 | build-project async-ssl-system-executor ; 19 | build-project coro-ssl ; 20 | build-project sync-ssl ; 21 | -------------------------------------------------------------------------------- /test/beast/version.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // If including Windows.h generates errors, it 11 | // means that min/max macros are being substituted. 12 | #ifdef _MSC_VER 13 | #define WIN32_LEAN_AND_MEAN 14 | #include 15 | #endif 16 | 17 | // Test that header file is self-contained. 18 | #include 19 | -------------------------------------------------------------------------------- /test/beast/websocket.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // If including Windows.h generates errors, it 11 | // means that min/max macros are being substituted. 12 | #ifdef _MSC_VER 13 | #define WIN32_LEAN_AND_MEAN 14 | #include 15 | #endif 16 | 17 | // Test that header file is self-contained. 18 | #include 19 | -------------------------------------------------------------------------------- /test/doc/snippets.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef SNIPPETS_HPP 11 | #define SNIPPETS_HPP 12 | 13 | // This file must be included before including snippets.ipp 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /cmake/toolchains/common.cmake: -------------------------------------------------------------------------------- 1 | # C++ standard. 2 | set(CMAKE_CXX_EXTENSIONS OFF CACHE STRING "") 3 | 4 | # Static library linkage. 5 | set(BUILD_SHARED_LIBS OFF CACHE STRING "") 6 | add_definitions(-DBOOST_ALL_STATIC_LINK=1) 7 | 8 | # Interprocedural optimization. 9 | set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON CACHE STRING "") 10 | set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL ON CACHE STRING "") 11 | set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO ON CACHE STRING "") 12 | 13 | # Compiler definitions. 14 | if(WIN32) 15 | add_definitions(-D_WIN32_WINNT=0x0A00 -D_CRT_SECURE_NO_WARNINGS) 16 | endif() 17 | 18 | # Project options. 19 | -------------------------------------------------------------------------------- /include/boost/beast/http/basic_file_body_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_HTTP_BASIC_FILE_BODY_FWD_HPP 11 | #define BOOST_BEAST_HTTP_BASIC_FILE_BODY_FWD_HPP 12 | 13 | namespace boost { 14 | namespace beast { 15 | namespace http { 16 | 17 | template 18 | struct basic_file_body; 19 | 20 | } // http 21 | } // beast 22 | } // boost 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /test/doc/websocket_common.ipp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | //[code_websocket_1b 11 | 12 | namespace net = boost::asio; 13 | namespace beast = boost::beast; 14 | using namespace boost::beast; 15 | using namespace boost::beast::websocket; 16 | 17 | net::io_context ioc; 18 | tcp_stream sock(ioc); 19 | net::ssl::context ctx(net::ssl::context::tlsv12); 20 | 21 | //] 22 | -------------------------------------------------------------------------------- /include/boost/beast/http/basic_dynamic_body_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_HTTP_BASIC_DYNAMIC_BODY_FWD_HPP 11 | #define BOOST_BEAST_HTTP_BASIC_DYNAMIC_BODY_FWD_HPP 12 | 13 | namespace boost { 14 | namespace beast { 15 | namespace http { 16 | 17 | template 18 | struct basic_dynamic_body; 19 | 20 | } // http 21 | } // beast 22 | } // boost 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /test/bench/parser/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | project : requirements /boost/beast/test//lib-test ; 11 | 12 | run 13 | nodejs_parser.cpp 14 | bench_parser.cpp 15 | : : : : 16 | bench-parser ; 17 | 18 | explicit bench-parser ; 19 | 20 | alias run-tests : 21 | [ compile nodejs_parser.cpp ] 22 | [ compile bench_parser.cpp ] 23 | ; 24 | -------------------------------------------------------------------------------- /doc/qbk/version.qbk: -------------------------------------------------------------------------------- 1 | [/ 2 | Copyright (c) 2022 Klemens D. Morgenstern (klemens dot morgenstern at gmx dot net) 3 | 4 | Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | Official repository: https://github.com/boostorg/beast 8 | ] 9 | 10 | [section Beast API Version] 11 | 12 | Beast maintains it's own API version, which is more fine-grained than the 13 | boost release. 14 | 15 | It can be obtained as a string from the `BOOST_BEAST_VERSION` macro 16 | or a string through `BOOST_BEAST_VERSION_STRING`. 17 | 18 | [version] 19 | 20 | 21 | [endsect] 22 | -------------------------------------------------------------------------------- /example/echo-op/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(echo-op 12 | Jamfile 13 | echo_op.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | echo_op.cpp) 18 | 19 | target_link_libraries(echo-op PRIVATE Boost::beast) 20 | 21 | set_target_properties(echo-op 22 | PROPERTIES FOLDER "example-echo-op") 23 | -------------------------------------------------------------------------------- /include/boost/beast/zlib.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_ZLIB_HPP 11 | #define BOOST_BEAST_ZLIB_HPP 12 | 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /include/boost/beast/http/vector_body_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_HTTP_VECTOR_BODY_FWD_HPP 11 | #define BOOST_BEAST_HTTP_VECTOR_BODY_FWD_HPP 12 | 13 | #include 14 | 15 | namespace boost { 16 | namespace beast { 17 | namespace http { 18 | 19 | template> 20 | struct vector_body; 21 | 22 | } // http 23 | } // beast 24 | } // boost 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /example/http/client/async-local/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2025 Mohammad Nejati 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | add_executable(http-client-async-local 11 | Jamfile 12 | http_client_async_local.cpp) 13 | 14 | source_group("" FILES 15 | Jamfile 16 | http_client_async_local.cpp) 17 | 18 | target_link_libraries(http-client-async-local PRIVATE Boost::beast) 19 | 20 | set_target_properties(http-client-async-local 21 | PROPERTIES FOLDER "example-http-client") 22 | -------------------------------------------------------------------------------- /example/http/server/async-local/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2025 Mohammad Nejati 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | add_executable(http-server-async-local 11 | Jamfile 12 | http_server_async_local.cpp) 13 | 14 | source_group("" FILES 15 | Jamfile 16 | http_server_async_local.cpp) 17 | 18 | target_link_libraries(http-server-async-local PRIVATE Boost::beast) 19 | 20 | set_target_properties(http-server-async-local 21 | PROPERTIES FOLDER "example-http-server") 22 | -------------------------------------------------------------------------------- /include/boost/beast.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_HPP 11 | #define BOOST_BEAST_HPP 12 | 13 | #include // must come first 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /example/http/server/flex/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import ac ; 11 | 12 | project 13 | : requirements 14 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 15 | ; 16 | 17 | exe http-server-flex : 18 | http_server_flex.cpp 19 | : 20 | coverage:no 21 | ubasan:no 22 | ; 23 | -------------------------------------------------------------------------------- /example/websocket/client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | add_subdirectory(async) 11 | add_subdirectory(async-local) 12 | add_subdirectory(awaitable) 13 | add_subdirectory(coro) 14 | add_subdirectory(sync) 15 | 16 | if (OPENSSL_FOUND) 17 | add_subdirectory(async-ssl) 18 | add_subdirectory(async-ssl-system-executor) 19 | add_subdirectory(coro-ssl) 20 | add_subdirectory(sync-ssl) 21 | endif () 22 | -------------------------------------------------------------------------------- /example/advanced/server-flex/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import ac ; 11 | 12 | project 13 | : requirements 14 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 15 | ; 16 | 17 | exe advanced-server-flex : 18 | advanced_server_flex.cpp 19 | : 20 | coverage:no 21 | ubasan:no 22 | ; 23 | -------------------------------------------------------------------------------- /example/advanced/server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(advanced-server 12 | Jamfile 13 | advanced_server.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | advanced_server.cpp) 18 | 19 | target_link_libraries(advanced-server PRIVATE Boost::beast) 20 | 21 | set_target_properties(advanced-server PROPERTIES FOLDER "example-advanced-server") 22 | -------------------------------------------------------------------------------- /example/http/client/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | build-project async ; 11 | build-project async-local ; 12 | build-project coro ; 13 | build-project crawl ; 14 | build-project sync ; 15 | build-project awaitable ; 16 | 17 | # SSL 18 | build-project async-ssl ; 19 | build-project awaitable-ssl ; 20 | build-project coro-ssl ; 21 | build-project sync-ssl ; 22 | 23 | build-project body ; 24 | 25 | build-project methods ; 26 | -------------------------------------------------------------------------------- /example/http/client/async-ssl/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import ac ; 11 | 12 | project 13 | : requirements 14 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 15 | ; 16 | 17 | exe http-client-async-ssl : 18 | http_client_async_ssl.cpp 19 | : 20 | coverage:no 21 | ubasan:no 22 | ; 23 | -------------------------------------------------------------------------------- /example/http/client/sync-ssl/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import ac ; 11 | 12 | project 13 | : requirements 14 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 15 | ; 16 | 17 | exe http-client-sync-ssl : 18 | http_client_sync_ssl.cpp 19 | : 20 | coverage:no 21 | ubasan:no 22 | ; 23 | -------------------------------------------------------------------------------- /example/http/server/async-ssl/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import ac ; 11 | 12 | project 13 | : requirements 14 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 15 | ; 16 | 17 | exe http-server-async-ssl : 18 | http_server_async_ssl.cpp 19 | : 20 | coverage:no 21 | ubasan:no 22 | ; 23 | -------------------------------------------------------------------------------- /example/http/server/sync-ssl/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import ac ; 11 | 12 | project 13 | : requirements 14 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 15 | ; 16 | 17 | exe http-server-sync-ssl : 18 | http_server_sync_ssl.cpp 19 | : 20 | coverage:no 21 | ubasan:no 22 | ; 23 | -------------------------------------------------------------------------------- /example/websocket/server/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | build-project async ; 11 | build-project async-local ; 12 | build-project awaitable ; 13 | build-project chat-multi ; 14 | build-project coro ; 15 | build-project fast ; 16 | build-project stackless ; 17 | build-project sync ; 18 | 19 | # SSL 20 | build-project async-ssl ; 21 | build-project coro-ssl ; 22 | build-project stackless-ssl ; 23 | build-project sync-ssl ; 24 | -------------------------------------------------------------------------------- /example/websocket/server/chat-multi/net.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/vinniefalco/CppCon2018 8 | // 9 | 10 | #ifndef BOOST_BEAST_EXAMPLE_WEBSOCKET_CHAT_MULTI_NET_HPP 11 | #define BOOST_BEAST_EXAMPLE_WEBSOCKET_CHAT_MULTI_NET_HPP 12 | 13 | #include 14 | 15 | namespace net = boost::asio; // from 16 | using tcp = boost::asio::ip::tcp; // from 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /example/http/client/coro/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-client-coro 12 | Jamfile 13 | http_client_coro.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_client_coro.cpp) 18 | 19 | target_link_libraries(http-client-coro PRIVATE Boost::beast) 20 | 21 | set_target_properties(http-client-coro 22 | PROPERTIES FOLDER "example-http-client") 23 | -------------------------------------------------------------------------------- /example/http/client/sync/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-client-sync 12 | Jamfile 13 | http_client_sync.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_client_sync.cpp) 18 | 19 | target_link_libraries(http-client-sync PRIVATE Boost::beast) 20 | 21 | set_target_properties(http-client-sync 22 | PROPERTIES FOLDER "example-http-client") 23 | -------------------------------------------------------------------------------- /example/http/server/coro/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-server-coro 12 | Jamfile 13 | http_server_coro.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_server_coro.cpp) 18 | 19 | target_link_libraries(http-server-coro PRIVATE Boost::beast) 20 | 21 | set_target_properties(http-server-coro 22 | PROPERTIES FOLDER "example-http-server") 23 | -------------------------------------------------------------------------------- /example/http/server/fast/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-server-fast 12 | Jamfile 13 | http_server_fast.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_server_fast.cpp) 18 | 19 | target_link_libraries(http-server-fast PRIVATE Boost::beast) 20 | 21 | set_target_properties(http-server-fast 22 | PROPERTIES FOLDER "example-http-server") 23 | -------------------------------------------------------------------------------- /example/http/server/sync/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-server-sync 12 | Jamfile 13 | http_server_sync.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_server_sync.cpp) 18 | 19 | target_link_libraries(http-server-sync PRIVATE Boost::beast) 20 | 21 | set_target_properties(http-server-sync 22 | PROPERTIES FOLDER "example-http-server") 23 | -------------------------------------------------------------------------------- /example/websocket/client/async-local/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024 Mohammad Nejati 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | add_executable(websocket-client-async-local 11 | Jamfile 12 | websocket_client_async_local.cpp) 13 | 14 | source_group("" FILES 15 | Jamfile 16 | websocket_client_async_local.cpp) 17 | 18 | target_link_libraries(websocket-client-async-local PRIVATE Boost::beast) 19 | 20 | set_target_properties(websocket-client-async-local 21 | PROPERTIES FOLDER "example-websocket-client") 22 | -------------------------------------------------------------------------------- /example/websocket/server/async-local/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2025 Mohammad Nejati 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | add_executable(websocket-server-async-local 11 | Jamfile 12 | websocket_server_async_local.cpp) 13 | 14 | source_group("" FILES 15 | Jamfile 16 | websocket_server_async_local.cpp) 17 | 18 | target_link_libraries(websocket-server-async-local PRIVATE Boost::beast) 19 | 20 | set_target_properties(websocket-server-async-local 21 | PROPERTIES FOLDER "example-websocket-server") 22 | -------------------------------------------------------------------------------- /test/bench/wsload/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(boost_beast_bench_wsload 12 | Jamfile 13 | wsload.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | wsload.cpp) 18 | 19 | target_link_libraries(boost_beast_bench_wsload 20 | boost_beast_lib_beast) 21 | 22 | set_target_properties(boost_beast_bench_wsload 23 | PROPERTIES FOLDER "tests-bench") 24 | -------------------------------------------------------------------------------- /example/http/client/async/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-client-async 12 | Jamfile 13 | http_client_async.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_client_async.cpp) 18 | 19 | target_link_libraries(http-client-async PRIVATE Boost::beast) 20 | 21 | set_target_properties(http-client-async 22 | PROPERTIES FOLDER "example-http-client") 23 | -------------------------------------------------------------------------------- /example/http/client/awaitable-ssl/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import ac ; 11 | 12 | project 13 | : requirements 14 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 15 | ; 16 | 17 | exe http-client-awaitable-ssl : 18 | http_client_awaitable_ssl.cpp 19 | : 20 | coverage:no 21 | ubasan:no 22 | ; 23 | -------------------------------------------------------------------------------- /example/http/client/body/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-client-json 12 | Jamfile 13 | json_client.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | json_client.cpp) 18 | 19 | target_link_libraries(http-client-json PRIVATE Boost::beast Boost::json) 20 | 21 | set_target_properties(http-client-json 22 | PROPERTIES FOLDER "example-http-client") 23 | -------------------------------------------------------------------------------- /example/http/server/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | build-project async ; 11 | build-project async-local ; 12 | build-project coro ; 13 | build-project fast ; 14 | build-project small ; 15 | build-project stackless ; 16 | build-project sync ; 17 | build-project awaitable ; 18 | 19 | # SSL 20 | build-project async-ssl ; 21 | build-project coro-ssl ; 22 | build-project flex ; 23 | build-project stackless-ssl ; 24 | build-project sync-ssl ; 25 | -------------------------------------------------------------------------------- /example/http/server/async/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-server-async 12 | Jamfile 13 | http_server_async.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_server_async.cpp) 18 | 19 | target_link_libraries(http-server-async PRIVATE Boost::beast) 20 | 21 | set_target_properties(http-server-async 22 | PROPERTIES FOLDER "example-http-server") 23 | -------------------------------------------------------------------------------- /example/http/server/small/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-server-small 12 | Jamfile 13 | http_server_small.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_server_small.cpp) 18 | 19 | target_link_libraries(http-server-small PRIVATE Boost::beast) 20 | 21 | set_target_properties(http-server-small 22 | PROPERTIES FOLDER "example-http-server") 23 | -------------------------------------------------------------------------------- /example/http/server/stackless-ssl/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import ac ; 11 | 12 | project 13 | : requirements 14 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 15 | ; 16 | 17 | exe http-server-stackless-ssl : 18 | http_server_stackless_ssl.cpp 19 | : 20 | coverage:no 21 | ubasan:no 22 | ; 23 | -------------------------------------------------------------------------------- /example/websocket/client/async-ssl/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import ac ; 11 | 12 | project 13 | : requirements 14 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 15 | ; 16 | 17 | exe websocket-client-async-ssl : 18 | websocket_client_async_ssl.cpp 19 | : 20 | coverage:no 21 | ubasan:no 22 | ; 23 | -------------------------------------------------------------------------------- /example/websocket/client/sync-ssl/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import ac ; 11 | 12 | project 13 | : requirements 14 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 15 | ; 16 | 17 | exe websocket-client-sync-ssl : 18 | websocket_client_sync_ssl.cpp 19 | : 20 | coverage:no 21 | ubasan:no 22 | ; 23 | -------------------------------------------------------------------------------- /example/websocket/server/async-ssl/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import ac ; 11 | 12 | project 13 | : requirements 14 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 15 | ; 16 | 17 | exe websocket-server-async-ssl : 18 | websocket_server_async_ssl.cpp 19 | : 20 | coverage:no 21 | ubasan:no 22 | ; 23 | -------------------------------------------------------------------------------- /example/websocket/server/sync-ssl/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import ac ; 11 | 12 | project 13 | : requirements 14 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 15 | ; 16 | 17 | exe websocket-server-sync-ssl : 18 | websocket_server_sync_ssl.cpp 19 | : 20 | coverage:no 21 | ubasan:no 22 | ; 23 | -------------------------------------------------------------------------------- /include/boost/beast/core/span.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_CORE_SPAN_HPP 11 | #define BOOST_BEAST_CORE_SPAN_HPP 12 | 13 | #include 14 | #include 15 | 16 | namespace boost { 17 | namespace beast { 18 | 19 | template 20 | using span = boost::span; 21 | 22 | } // beast 23 | } // boost 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /test/bench/buffers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(boost_beast_bench_buffers 12 | Jamfile 13 | bench_buffers.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | bench_buffers.cpp) 18 | 19 | target_link_libraries(boost_beast_bench_buffers 20 | boost_beast_lib_test) 21 | 22 | set_target_properties(boost_beast_bench_buffers 23 | PROPERTIES FOLDER "tests-bench") 24 | -------------------------------------------------------------------------------- /example/advanced/server-flex-awaitable/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import ac ; 11 | 12 | project 13 | : requirements 14 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 15 | ; 16 | 17 | exe advanced-server-flex-awaitable : 18 | advanced_server_flex_awaitable.cpp 19 | : 20 | coverage:no 21 | ubasan:no 22 | ; 23 | -------------------------------------------------------------------------------- /example/http/client/methods/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-client-methods 12 | Jamfile 13 | http_client_methods.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_client_methods.cpp) 18 | 19 | target_link_libraries(http-client-methods PRIVATE Boost::beast) 20 | 21 | set_target_properties(http-client-methods 22 | PROPERTIES FOLDER "example-http-client") 23 | -------------------------------------------------------------------------------- /example/websocket/server/stackless-ssl/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import ac ; 11 | 12 | project 13 | : requirements 14 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 15 | ; 16 | 17 | exe websocket-server-stackless-ssl : 18 | websocket_server_stackless_ssl.cpp 19 | : 20 | coverage:no 21 | ubasan:no 22 | ; 23 | -------------------------------------------------------------------------------- /include/boost/beast/http/fields_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_HTTP_FIELDS_FWD_HPP 11 | #define BOOST_BEAST_HTTP_FIELDS_FWD_HPP 12 | 13 | #include 14 | 15 | namespace boost { 16 | namespace beast { 17 | namespace http { 18 | 19 | template 20 | class basic_fields; 21 | 22 | #ifndef BOOST_BEAST_DOXYGEN 23 | using fields = basic_fields>; 24 | #endif 25 | 26 | } // http 27 | } // beast 28 | } // boost 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /example/http/client/awaitable/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-client-awaitable 12 | Jamfile 13 | http_client_awaitable.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_client_awaitable.cpp) 18 | 19 | target_link_libraries(http-client-awaitable PRIVATE Boost::beast) 20 | 21 | set_target_properties(http-client-awaitable 22 | PROPERTIES FOLDER "example-http-client") 23 | -------------------------------------------------------------------------------- /example/http/client/crawl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-crawl 12 | Jamfile 13 | http_crawl.cpp 14 | urls_large_data.cpp) 15 | 16 | source_group("" FILES 17 | Jamfile 18 | http_crawl.cpp 19 | urls_large_data.cpp) 20 | 21 | target_link_libraries(http-crawl PRIVATE Boost::beast) 22 | 23 | set_target_properties(http-crawl 24 | PROPERTIES FOLDER "example-http-client") 25 | -------------------------------------------------------------------------------- /example/http/server/awaitable/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-server-awaitable 12 | Jamfile 13 | http_server_awaitable.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_server_awaitable.cpp) 18 | 19 | target_link_libraries(http-server-awaitable PRIVATE Boost::beast) 20 | 21 | set_target_properties(http-server-awaitable 22 | PROPERTIES FOLDER "example-http-server") 23 | -------------------------------------------------------------------------------- /example/http/server/stackless/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-server-stackless 12 | Jamfile 13 | http_server_stackless.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_server_stackless.cpp) 18 | 19 | target_link_libraries(http-server-stackless PRIVATE Boost::beast) 20 | 21 | set_target_properties(http-server-stackless 22 | PROPERTIES FOLDER "example-http-server") 23 | -------------------------------------------------------------------------------- /example/http/client/coro-ssl/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import ac ; 11 | 12 | project 13 | : requirements 14 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 15 | ; 16 | 17 | exe http-client-coro-ssl : 18 | http_client_coro_ssl.cpp 19 | : 20 | coverage:no 21 | ubasan:no 22 | /boost/context//boost_context 23 | ; 24 | -------------------------------------------------------------------------------- /example/http/server/coro-ssl/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import ac ; 11 | 12 | project 13 | : requirements 14 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 15 | ; 16 | 17 | exe http-server-coro-ssl : 18 | http_server_coro_ssl.cpp 19 | : 20 | coverage:no 21 | ubasan:no 22 | /boost/context//boost_context 23 | ; 24 | -------------------------------------------------------------------------------- /example/websocket/client/coro/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(websocket-client-coro 12 | Jamfile 13 | websocket_client_coro.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | websocket_client_coro.cpp) 18 | 19 | target_link_libraries(websocket-client-coro PRIVATE Boost::beast) 20 | 21 | set_target_properties(websocket-client-coro 22 | PROPERTIES FOLDER "example-websocket-client") 23 | -------------------------------------------------------------------------------- /example/websocket/client/sync/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(websocket-client-sync 12 | Jamfile 13 | websocket_client_sync.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | websocket_client_sync.cpp) 18 | 19 | target_link_libraries(websocket-client-sync PRIVATE Boost::beast) 20 | 21 | set_target_properties(websocket-client-sync 22 | PROPERTIES FOLDER "example-websocket-client") 23 | -------------------------------------------------------------------------------- /example/websocket/server/coro/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(websocket-server-coro 12 | Jamfile 13 | websocket_server_coro.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | websocket_server_coro.cpp) 18 | 19 | target_link_libraries(websocket-server-coro PRIVATE Boost::beast) 20 | 21 | set_target_properties(websocket-server-coro 22 | PROPERTIES FOLDER "example-websocket-server") 23 | -------------------------------------------------------------------------------- /example/websocket/server/fast/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(websocket-server-fast 12 | Jamfile 13 | websocket_server_fast.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | websocket_server_fast.cpp) 18 | 19 | target_link_libraries(websocket-server-fast PRIVATE Boost::beast) 20 | 21 | set_target_properties(websocket-server-fast 22 | PROPERTIES FOLDER "example-websocket-server") 23 | -------------------------------------------------------------------------------- /example/websocket/server/sync/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(websocket-server-sync 12 | Jamfile 13 | websocket_server_sync.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | websocket_server_sync.cpp) 18 | 19 | target_link_libraries(websocket-server-sync PRIVATE Boost::beast) 20 | 21 | set_target_properties(websocket-server-sync 22 | PROPERTIES FOLDER "example-websocket-server") 23 | -------------------------------------------------------------------------------- /example/http/client/async-ssl-system-executor/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import ac ; 11 | 12 | project 13 | : requirements 14 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 15 | ; 16 | 17 | exe http-client-async-ssl-system-executor : 18 | http_client_async_ssl_system_executor.cpp 19 | : 20 | coverage:no 21 | ubasan:no 22 | ; 23 | -------------------------------------------------------------------------------- /example/websocket/client/async/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(websocket-client-async 12 | Jamfile 13 | websocket_client_async.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | websocket_client_async.cpp) 18 | 19 | target_link_libraries(websocket-client-async PRIVATE Boost::beast) 20 | 21 | set_target_properties(websocket-client-async 22 | PROPERTIES FOLDER "example-websocket-client") 23 | -------------------------------------------------------------------------------- /example/websocket/server/async/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(websocket-server-async 12 | Jamfile 13 | websocket_server_async.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | websocket_server_async.cpp) 18 | 19 | target_link_libraries(websocket-server-async PRIVATE Boost::beast) 20 | 21 | set_target_properties(websocket-server-async 22 | PROPERTIES FOLDER "example-websocket-server") 23 | -------------------------------------------------------------------------------- /include/boost/beast/http/file_body_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_HTTP_FILE_BODY_FWD_HPP 11 | #define BOOST_BEAST_HTTP_FILE_BODY_FWD_HPP 12 | 13 | #include 14 | 15 | #include 16 | 17 | namespace boost { 18 | namespace beast { 19 | namespace http { 20 | 21 | #ifndef BOOST_BEAST_DOXYGEN 22 | using file_body = basic_file_body; 23 | #endif 24 | 25 | } // http 26 | } // beast 27 | } // boost 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Boost.Beast 4 | 5 | 6 | 7 | Automatic redirection failed, please go to 8 | ./doc/html/index.html 9 |
10 | 11 | Boost.Beast
12 |
13 | Copyright (C) 2016-2017 Vinnie Falco
14 |
15 | Distributed under the Boost Software License, Version 1.0. 16 | (See accompanying file LICENSE_1_0.txt or copy at 17 | http://www.boost.org/LICENSE_1_0.txt)
18 |
19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /test/bench/utf8_checker/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(boost_beast_bench_utf8_checker 12 | Jamfile 13 | bench_utf8_checker.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | bench_utf8_checker.cpp) 18 | 19 | target_link_libraries(boost_beast_bench_utf8_checker 20 | boost_beast_lib_test) 21 | 22 | set_target_properties(boost_beast_bench_utf8_checker 23 | PROPERTIES FOLDER "tests-bench") 24 | -------------------------------------------------------------------------------- /example/websocket/client/coro-ssl/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import ac ; 11 | 12 | project 13 | : requirements 14 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 15 | ; 16 | 17 | exe websocket-client-coro-ssl : 18 | websocket_client_coro_ssl.cpp 19 | : 20 | coverage:no 21 | ubasan:no 22 | /boost/context//boost_context 23 | ; 24 | -------------------------------------------------------------------------------- /example/websocket/server/coro-ssl/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import ac ; 11 | 12 | project 13 | : requirements 14 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 15 | ; 16 | 17 | exe websocket-server-coro-ssl : 18 | websocket_server_coro_ssl.cpp 19 | : 20 | coverage:no 21 | ubasan:no 22 | /boost/context//boost_context 23 | ; 24 | -------------------------------------------------------------------------------- /example/websocket/client/async-ssl-system-executor/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import ac ; 11 | 12 | project 13 | : requirements 14 | [ ac.check-library /boost/beast/test//lib-asio-ssl : /boost/beast/test//lib-asio-ssl/static : no ] 15 | ; 16 | 17 | exe websocket-client-async-ssl-system-executor : 18 | websocket_client_async_ssl_system_executor.cpp 19 | : 20 | coverage:no 21 | ubasan:no 22 | ; 23 | -------------------------------------------------------------------------------- /test/beast/websocket/stream_explicit.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | namespace boost { 17 | namespace beast { 18 | 19 | template class websocket::stream; 20 | template class websocket::stream; 21 | 22 | } // beast 23 | } // boost 24 | -------------------------------------------------------------------------------- /test/example/common/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | project 11 | : requirements 12 | ../../.. ; 13 | 14 | local SOURCES = 15 | root_certificates.cpp 16 | server_certificate.cpp 17 | ; 18 | 19 | local RUN_TESTS ; 20 | 21 | local libs = 22 | /boost/beast/test//lib-asio-ssl 23 | /boost/beast/test//lib-test 24 | ; 25 | 26 | for local f in $(SOURCES) 27 | { 28 | RUN_TESTS += [ run $(f) $(libs) ] ; 29 | } 30 | 31 | alias run-tests : $(RUN_TESTS) ; 32 | -------------------------------------------------------------------------------- /test/extern/zlib-1.3.1/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #include "gzguts.h" 7 | 8 | /* gzclose() is in a separate file so that it is linked in only if it is used. 9 | That way the other gzclose functions can be used instead to avoid linking in 10 | unneeded compression or decompression routines. */ 11 | int ZEXPORT gzclose(gzFile file) { 12 | #ifndef NO_GZCOMPRESS 13 | gz_statep state; 14 | 15 | if (file == NULL) 16 | return Z_STREAM_ERROR; 17 | state = (gz_statep)file; 18 | 19 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 20 | #else 21 | return gzclose_r(file); 22 | #endif 23 | } 24 | -------------------------------------------------------------------------------- /example/websocket/client/awaitable/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(websocket-client-awaitable 12 | Jamfile 13 | websocket_client_awaitable.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | websocket_client_awaitable.cpp) 18 | 19 | target_link_libraries(websocket-client-awaitable PRIVATE Boost::beast) 20 | 21 | set_target_properties(websocket-client-awaitable 22 | PROPERTIES FOLDER "example-websocket-client") 23 | -------------------------------------------------------------------------------- /example/websocket/server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | add_subdirectory(async) 11 | add_subdirectory(async-local) 12 | add_subdirectory(awaitable) 13 | add_subdirectory(chat-multi) 14 | add_subdirectory(coro) 15 | add_subdirectory(fast) 16 | add_subdirectory(stackless) 17 | add_subdirectory(sync) 18 | 19 | if (OPENSSL_FOUND) 20 | add_subdirectory(async-ssl) 21 | add_subdirectory(coro-ssl) 22 | add_subdirectory(stackless-ssl) 23 | add_subdirectory(sync-ssl) 24 | endif () 25 | -------------------------------------------------------------------------------- /example/websocket/server/awaitable/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(websocket-server-awaitable 12 | Jamfile 13 | websocket_server_awaitable.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | websocket_server_awaitable.cpp) 18 | 19 | target_link_libraries(websocket-server-awaitable PRIVATE Boost::beast) 20 | 21 | set_target_properties(websocket-server-awaitable 22 | PROPERTIES FOLDER "example-websocket-server") 23 | -------------------------------------------------------------------------------- /example/websocket/server/stackless/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(websocket-server-stackless 12 | Jamfile 13 | websocket_server_stackless.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | websocket_server_stackless.cpp) 18 | 19 | target_link_libraries(websocket-server-stackless PRIVATE Boost::beast) 20 | 21 | set_target_properties(websocket-server-stackless 22 | PROPERTIES FOLDER "example-websocket-server") 23 | -------------------------------------------------------------------------------- /.codecov.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2019 - 2021 Alexander Grund 2 | # Distributed under the Boost Software License, Version 1.0. 3 | # (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) 4 | # 5 | # Sample codecov configuration file. Edit as required 6 | 7 | codecov: 8 | max_report_age: off 9 | require_ci_to_pass: yes 10 | notify: 11 | # Increase this if you have multiple coverage collection jobs 12 | after_n_builds: 1 13 | wait_for_ci: yes 14 | 15 | # Change how pull request comments look 16 | comment: 17 | layout: "reach,diff,flags,files,footer" 18 | 19 | # Ignore specific files or folders. Glob patterns are supported. 20 | # See https://docs.codecov.com/docs/ignoring-paths 21 | ignore: 22 | - extra/* 23 | - extra/**/* 24 | - test/* 25 | - test/**/* 26 | -------------------------------------------------------------------------------- /test/fuzz/http_request.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mikhail Khachayants 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | 8 | #include 9 | #include 10 | 11 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) 12 | { 13 | using namespace boost::beast; 14 | 15 | error_code ec; 16 | flat_buffer buffer; 17 | net::io_context ioc; 18 | test::stream stream{ioc, {reinterpret_cast(data), size}}; 19 | stream.close_remote(); 20 | 21 | http::request_parser parser; 22 | http::read(stream, buffer, parser, ec); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /doc/qbk/07_concepts/_concepts.qbk: -------------------------------------------------------------------------------- 1 | [/ 2 | Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | 4 | Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | Official repository: https://github.com/boostorg/beast 8 | ] 9 | 10 | [section:concepts Concepts] 11 | 12 | This section describes all of the concepts defined by the library. 13 | 14 | [include Body.qbk] 15 | [include BodyReader.qbk] 16 | [include BodyWriter.qbk] 17 | [include BufferSequence.qbk] 18 | [include BuffersGenerator.qbk] 19 | [include DynamicBuffer.qbk] 20 | [include Fields.qbk] 21 | [include FieldsWriter.qbk] 22 | [include File.qbk] 23 | [include RatePolicy.qbk] 24 | [include Streams.qbk] 25 | 26 | [endsect] 27 | -------------------------------------------------------------------------------- /example/http/server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | add_subdirectory(async) 11 | add_subdirectory(async-local) 12 | add_subdirectory(awaitable) 13 | add_subdirectory(coro) 14 | add_subdirectory(fast) 15 | add_subdirectory(small) 16 | add_subdirectory(stackless) 17 | add_subdirectory(sync) 18 | 19 | if (OPENSSL_FOUND) 20 | add_subdirectory(async-ssl) 21 | add_subdirectory(coro-ssl) 22 | add_subdirectory(flex) 23 | add_subdirectory(stackless-ssl) 24 | add_subdirectory(sync-ssl) 25 | endif () 26 | -------------------------------------------------------------------------------- /example/websocket/server/chat-multi/beast.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/vinniefalco/CppCon2018 8 | // 9 | 10 | #ifndef BOOST_BEAST_EXAMPLE_WEBSOCKET_CHAT_MULTI_BEAST_HPP 11 | #define BOOST_BEAST_EXAMPLE_WEBSOCKET_CHAT_MULTI_BEAST_HPP 12 | 13 | #include 14 | 15 | namespace beast = boost::beast; // from 16 | namespace http = beast::http; // from 17 | namespace websocket = beast::websocket; // from 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /test/beast/http/empty_body.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | 13 | #include 14 | 15 | namespace boost { 16 | namespace beast { 17 | namespace http { 18 | 19 | BOOST_CORE_STATIC_ASSERT(is_body::value); 20 | BOOST_CORE_STATIC_ASSERT(is_body_writer::value); 21 | BOOST_CORE_STATIC_ASSERT(is_body_reader::value); 22 | 23 | } // http 24 | } // beast 25 | } // boost 26 | -------------------------------------------------------------------------------- /test/beast/http/string_body.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | 13 | #include 14 | 15 | namespace boost { 16 | namespace beast { 17 | namespace http { 18 | 19 | BOOST_CORE_STATIC_ASSERT(is_body::value); 20 | BOOST_CORE_STATIC_ASSERT(is_body_writer::value); 21 | BOOST_CORE_STATIC_ASSERT(is_body_reader::value); 22 | 23 | } // http 24 | } // beast 25 | } // boost 26 | -------------------------------------------------------------------------------- /example/http/client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | add_subdirectory(async) 11 | add_subdirectory(async-local) 12 | add_subdirectory(awaitable) 13 | add_subdirectory(body) 14 | add_subdirectory(coro) 15 | add_subdirectory(crawl) 16 | add_subdirectory(methods) 17 | add_subdirectory(sync) 18 | 19 | if (OPENSSL_FOUND) 20 | add_subdirectory(async-ssl) 21 | add_subdirectory(async-ssl-system-executor) 22 | add_subdirectory(awaitable-ssl) 23 | add_subdirectory(coro-ssl) 24 | add_subdirectory(sync-ssl) 25 | endif () 26 | -------------------------------------------------------------------------------- /test/beast/ssl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | add_executable (boost_beast_tests_ssl 11 | Jamfile 12 | ssl_stream.cpp) 13 | 14 | source_group("" FILES 15 | Jamfile 16 | ssl_stream.cpp) 17 | 18 | target_link_libraries(boost_beast_tests_ssl 19 | boost_beast_lib_asio_ssl 20 | boost_beast_lib_test) 21 | 22 | set_target_properties(boost_beast_tests_ssl 23 | PROPERTIES FOLDER "tests") 24 | 25 | add_test(NAME boost_beast_tests_ssl COMMAND boost_beast_tests_ssl) 26 | add_dependencies(tests boost_beast_tests_ssl) 27 | -------------------------------------------------------------------------------- /example/http/server/flex/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-server-flex 12 | Jamfile 13 | http_server_flex.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_server_flex.cpp) 18 | 19 | target_include_directories(http-server-flex 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(http-server-flex 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(http-server-flex 26 | PROPERTIES FOLDER "example-http-server") 27 | -------------------------------------------------------------------------------- /include/boost/beast/websocket.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_WEBSOCKET_HPP 11 | #define BOOST_BEAST_WEBSOCKET_HPP 12 | 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /include/boost/beast/websocket/stream_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_WEBSOCKET_STREAM_FWD_HPP 11 | #define BOOST_BEAST_WEBSOCKET_STREAM_FWD_HPP 12 | 13 | #include 14 | 15 | #ifndef BOOST_BEAST_DOXYGEN 16 | 17 | //[code_websocket_1h 18 | 19 | namespace boost { 20 | namespace beast { 21 | namespace websocket { 22 | 23 | template< 24 | class NextLayer, 25 | bool deflateSupported = true> 26 | class stream; 27 | 28 | } // websocket 29 | } // beast 30 | } // boost 31 | 32 | //] 33 | 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /example/http/client/coro-ssl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-client-coro-ssl 12 | Jamfile 13 | http_client_coro_ssl.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_client_coro_ssl.cpp) 18 | 19 | target_include_directories(http-client-coro-ssl 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(http-client-coro-ssl 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(http-client-coro-ssl 26 | PROPERTIES FOLDER "example-http-client") 27 | -------------------------------------------------------------------------------- /example/http/client/sync-ssl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-client-sync-ssl 12 | Jamfile 13 | http_client_sync_ssl.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_client_sync_ssl.cpp) 18 | 19 | target_include_directories(http-client-sync-ssl 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(http-client-sync-ssl 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(http-client-sync-ssl 26 | PROPERTIES FOLDER "example-http-client") 27 | -------------------------------------------------------------------------------- /example/http/server/coro-ssl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-server-coro-ssl 12 | Jamfile 13 | http_server_coro_ssl.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_server_coro_ssl.cpp) 18 | 19 | target_include_directories(http-server-coro-ssl 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(http-server-coro-ssl 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(http-server-coro-ssl 26 | PROPERTIES FOLDER "example-http-server") 27 | -------------------------------------------------------------------------------- /example/http/server/sync-ssl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-server-sync-ssl 12 | Jamfile 13 | http_server_sync_ssl.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_server_sync_ssl.cpp) 18 | 19 | target_include_directories(http-server-sync-ssl 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(http-server-sync-ssl 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(http-server-sync-ssl 26 | PROPERTIES FOLDER "example-http-server") 27 | -------------------------------------------------------------------------------- /example/advanced/server-flex/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(advanced-server-flex 12 | Jamfile 13 | advanced_server_flex.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | advanced_server_flex.cpp) 18 | 19 | target_include_directories(advanced-server-flex 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(advanced-server-flex 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(advanced-server-flex 26 | PROPERTIES FOLDER "example-advanced-server") 27 | -------------------------------------------------------------------------------- /include/boost/beast/http/string_body_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_HTTP_STRING_BODY_FWD_HPP 11 | #define BOOST_BEAST_HTTP_STRING_BODY_FWD_HPP 12 | 13 | #include 14 | #include 15 | 16 | namespace boost { 17 | namespace beast { 18 | namespace http { 19 | 20 | #ifndef BOOST_BEAST_DOXYGEN 21 | template< 22 | class CharT, 23 | class Traits = std::char_traits, 24 | class Allocator = std::allocator> 25 | struct basic_string_body; 26 | 27 | using string_body = basic_string_body; 28 | #endif 29 | 30 | } // http 31 | } // beast 32 | } // boost 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /test/beast/core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | file(GLOB_RECURSE PFILES CONFIGURE_DEPENDS Jamfile *.cpp *.hpp) 12 | 13 | add_executable(boost_beast_tests_core ${PFILES}) 14 | 15 | source_group("" FILES ${PFILES}) 16 | 17 | target_link_libraries(boost_beast_tests_core 18 | boost_beast_lib_test 19 | Boost::filesystem) 20 | 21 | set_target_properties(boost_beast_tests_core 22 | PROPERTIES FOLDER "tests") 23 | 24 | add_test(NAME boost_beast_tests_core COMMAND boost_beast_tests_core) 25 | add_dependencies(tests boost_beast_tests_core) 26 | -------------------------------------------------------------------------------- /test/beast/http/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | file(GLOB_RECURSE PFILES CONFIGURE_DEPENDS Jamfile *.cpp *.hpp) 12 | 13 | add_executable(boost_beast_tests_http ${PFILES}) 14 | 15 | source_group("" FILES ${PFILES}) 16 | 17 | target_link_libraries(boost_beast_tests_http 18 | boost_beast_lib_test 19 | Boost::filesystem) 20 | 21 | set_target_properties(boost_beast_tests_http 22 | PROPERTIES FOLDER "tests") 23 | 24 | add_test(NAME boost_beast_tests_http COMMAND boost_beast_tests_http) 25 | add_dependencies(tests boost_beast_tests_http) 26 | -------------------------------------------------------------------------------- /example/http/client/async-ssl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-client-async-ssl 12 | Jamfile 13 | http_client_async_ssl.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_client_async_ssl.cpp) 18 | 19 | target_include_directories(http-client-async-ssl 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(http-client-async-ssl 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(http-client-async-ssl 26 | PROPERTIES FOLDER "example-http-client") 27 | -------------------------------------------------------------------------------- /example/http/server/async-ssl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-server-async-ssl 12 | Jamfile 13 | http_server_async_ssl.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_server_async_ssl.cpp) 18 | 19 | target_include_directories(http-server-async-ssl 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(http-server-async-ssl 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(http-server-async-ssl 26 | PROPERTIES FOLDER "example-http-server") 27 | -------------------------------------------------------------------------------- /include/boost/beast/http/impl/error.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_HTTP_IMPL_ERROR_HPP 11 | #define BOOST_BEAST_HTTP_IMPL_ERROR_HPP 12 | 13 | #include 14 | 15 | namespace boost { 16 | namespace system { 17 | template<> 18 | struct is_error_code_enum<::boost::beast::http::error> 19 | { 20 | static bool const value = true; 21 | }; 22 | } // system 23 | } // boost 24 | 25 | namespace boost { 26 | namespace beast { 27 | namespace http { 28 | 29 | BOOST_BEAST_DECL 30 | error_code 31 | make_error_code(error ev); 32 | 33 | } // http 34 | } // beast 35 | } // boost 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /example/http/client/awaitable-ssl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-client-awaitable-ssl 12 | Jamfile 13 | http_client_awaitable_ssl.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_client_awaitable_ssl.cpp) 18 | 19 | target_include_directories(http-client-awaitable-ssl 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(http-client-awaitable-ssl 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(http-client-awaitable-ssl 26 | PROPERTIES FOLDER "example-http-client") 27 | -------------------------------------------------------------------------------- /example/http/server/stackless-ssl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-server-stackless-ssl 12 | Jamfile 13 | http_server_stackless_ssl.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_server_stackless_ssl.cpp) 18 | 19 | target_include_directories(http-server-stackless-ssl 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(http-server-stackless-ssl 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(http-server-stackless-ssl 26 | PROPERTIES FOLDER "example-http-server") 27 | -------------------------------------------------------------------------------- /example/websocket/client/coro-ssl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(websocket-client-coro-ssl 12 | Jamfile 13 | websocket_client_coro_ssl.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | websocket_client_coro_ssl.cpp) 18 | 19 | target_include_directories(websocket-client-coro-ssl 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(websocket-client-coro-ssl 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(websocket-client-coro-ssl 26 | PROPERTIES FOLDER "example-websocket-client") 27 | -------------------------------------------------------------------------------- /example/websocket/client/sync-ssl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(websocket-client-sync-ssl 12 | Jamfile 13 | websocket_client_sync_ssl.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | websocket_client_sync_ssl.cpp) 18 | 19 | target_include_directories(websocket-client-sync-ssl 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(websocket-client-sync-ssl 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(websocket-client-sync-ssl 26 | PROPERTIES FOLDER "example-websocket-client") 27 | -------------------------------------------------------------------------------- /example/websocket/server/coro-ssl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(websocket-server-coro-ssl 12 | Jamfile 13 | websocket_server_coro_ssl.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | websocket_server_coro_ssl.cpp) 18 | 19 | target_include_directories(websocket-server-coro-ssl 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(websocket-server-coro-ssl 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(websocket-server-coro-ssl 26 | PROPERTIES FOLDER "example-websocket-server") 27 | -------------------------------------------------------------------------------- /example/websocket/server/sync-ssl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(websocket-server-sync-ssl 12 | Jamfile 13 | websocket_server_sync_ssl.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | websocket_server_sync_ssl.cpp) 18 | 19 | target_include_directories(websocket-server-sync-ssl 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(websocket-server-sync-ssl 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(websocket-server-sync-ssl 26 | PROPERTIES FOLDER "example-websocket-server") 27 | -------------------------------------------------------------------------------- /test/beast/websocket/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | file(GLOB_RECURSE PFILES CONFIGURE_DEPENDS Jamfile *.cpp *.hpp) 12 | 13 | add_executable(boost_beast_tests_websocket ${PFILES}) 14 | 15 | source_group("" FILES ${PFILES}) 16 | 17 | target_link_libraries(boost_beast_tests_websocket 18 | boost_beast_lib_asio_ssl 19 | boost_beast_lib_test) 20 | 21 | set_target_properties(boost_beast_tests_websocket 22 | PROPERTIES FOLDER "tests") 23 | 24 | add_test(NAME boost_beast_tests_websocket COMMAND boost_beast_tests_websocket) 25 | add_dependencies(tests boost_beast_tests_websocket) 26 | -------------------------------------------------------------------------------- /test/bench/zlib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(boost_beast_bench_zlib 12 | Jamfile 13 | deflate_stream.cpp 14 | inflate_stream.cpp) 15 | 16 | source_group("" FILES 17 | Jamfile 18 | deflate_stream.cpp 19 | inflate_stream.cpp) 20 | 21 | target_include_directories(boost_beast_bench_zlib 22 | PRIVATE ${PROJECT_SOURCE_DIR}/test/extern) 23 | 24 | target_link_libraries(boost_beast_bench_zlib 25 | boost_beast_lib_test 26 | boost_beast_lib_zlib) 27 | 28 | set_target_properties(boost_beast_bench_zlib 29 | PROPERTIES FOLDER "tests-bench") 30 | -------------------------------------------------------------------------------- /example/websocket/client/async-ssl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(websocket-client-async-ssl 12 | Jamfile 13 | websocket_client_async_ssl.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | websocket_client_async_ssl.cpp) 18 | 19 | target_include_directories(websocket-client-async-ssl 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(websocket-client-async-ssl 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(websocket-client-async-ssl 26 | PROPERTIES FOLDER "example-websocket-client") 27 | -------------------------------------------------------------------------------- /example/websocket/server/async-ssl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(websocket-server-async-ssl 12 | Jamfile 13 | websocket_server_async_ssl.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | websocket_server_async_ssl.cpp) 18 | 19 | target_include_directories(websocket-server-async-ssl 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(websocket-server-async-ssl 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(websocket-server-async-ssl 26 | PROPERTIES FOLDER "example-websocket-server") 27 | -------------------------------------------------------------------------------- /test/bench/parser/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(boost_beast_bench_parser 12 | Jamfile 13 | nodejs_parser.hpp 14 | nodejs_parser.cpp 15 | bench_parser.cpp) 16 | 17 | source_group("" FILES 18 | Jamfile 19 | nodejs_parser.hpp 20 | nodejs_parser.cpp 21 | bench_parser.cpp) 22 | 23 | target_include_directories(boost_beast_bench_parser 24 | PRIVATE ${PROJECT_SOURCE_DIR}) 25 | 26 | target_link_libraries(boost_beast_bench_parser 27 | boost_beast_lib_test) 28 | 29 | set_target_properties(boost_beast_bench_parser 30 | PROPERTIES FOLDER "tests-bench") 31 | -------------------------------------------------------------------------------- /test/beast/core/file_win32.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | 13 | #if BOOST_BEAST_USE_WIN32_FILE 14 | 15 | #include "file_test.hpp" 16 | 17 | #include 18 | 19 | namespace boost { 20 | namespace beast { 21 | 22 | class file_win32_test 23 | : public beast::unit_test::suite 24 | { 25 | public: 26 | void 27 | run() 28 | { 29 | test_file(); 30 | } 31 | }; 32 | 33 | BEAST_DEFINE_TESTSUITE(beast,core,file_win32); 34 | 35 | } // beast 36 | } // boost 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /example/advanced/server-flex-awaitable/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(advanced-server-flex-awaitable 12 | Jamfile 13 | advanced_server_flex_awaitable.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | advanced_server_flex_awaitable.cpp) 18 | 19 | target_include_directories(advanced-server-flex-awaitable 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(advanced-server-flex-awaitable 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(advanced-server-flex-awaitable 26 | PROPERTIES FOLDER "example-advanced-server") 27 | -------------------------------------------------------------------------------- /example/websocket/server/stackless-ssl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(websocket-server-stackless-ssl 12 | Jamfile 13 | websocket_server_stackless_ssl.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | websocket_server_stackless_ssl.cpp) 18 | 19 | target_include_directories(websocket-server-stackless-ssl 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(websocket-server-stackless-ssl 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(websocket-server-stackless-ssl 26 | PROPERTIES FOLDER "example-websocket-server") 27 | -------------------------------------------------------------------------------- /include/boost/beast/http/dynamic_body_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_HTTP_DYNAMIC_BODY_FWD_HPP 11 | #define BOOST_BEAST_HTTP_DYNAMIC_BODY_FWD_HPP 12 | 13 | #include 14 | 15 | #include 16 | 17 | namespace boost { 18 | namespace beast { 19 | 20 | #ifndef BOOST_BEAST_DOXYGEN 21 | template 22 | class basic_multi_buffer; 23 | 24 | using multi_buffer = basic_multi_buffer>; 25 | #endif 26 | 27 | namespace http { 28 | 29 | #ifndef BOOST_BEAST_DOXYGEN 30 | using dynamic_body = basic_dynamic_body; 31 | #endif 32 | 33 | } // http 34 | } // beast 35 | } // boost 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /test/doc/snippets.ipp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // This header file is designed to be included multiple times 11 | // inside of function bodies holding documentation snippets. 12 | 13 | using namespace boost::beast; 14 | namespace net = boost::asio; 15 | namespace ssl = boost::asio::ssl; 16 | using tcp = net::ip::tcp; 17 | 18 | error_code ec; 19 | net::io_context ioc; 20 | net::any_io_executor work = 21 | net::require( 22 | ioc.get_executor(), 23 | net::execution::outstanding_work.tracked); 24 | std::thread t{[&](){ ioc.run(); }}; 25 | 26 | tcp::socket sock(ioc); 27 | 28 | ssl::context ctx(ssl::context::tlsv12); 29 | 30 | boost::ignore_unused(ec); 31 | -------------------------------------------------------------------------------- /test/extras/include/boost/beast/test/sig_wait.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_TEST_SIG_WAIT_HPP 11 | #define BOOST_BEAST_TEST_SIG_WAIT_HPP 12 | 13 | #include 14 | 15 | namespace boost { 16 | namespace beast { 17 | namespace test { 18 | 19 | /// Block until SIGINT or SIGTERM is received. 20 | inline 21 | void 22 | sig_wait() 23 | { 24 | net::io_context ioc; 25 | net::signal_set signals( 26 | ioc, SIGINT, SIGTERM); 27 | signals.async_wait( 28 | [&](boost::system::error_code const&, int) 29 | { 30 | }); 31 | ioc.run(); 32 | } 33 | 34 | } // test 35 | } // beast 36 | } // boost 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /test/bench/parser/nodejs_parser.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #if defined(__GNUC__) && (__GNUC__ >= 7) 11 | #pragma GCC diagnostic push 12 | #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" 13 | #endif 14 | 15 | #include 16 | 17 | #ifdef BOOST_MSVC 18 | # pragma warning (push) 19 | # pragma warning (disable: 4127) // conditional expression is constant 20 | # pragma warning (disable: 4244) // integer conversion, possible loss of data 21 | #endif 22 | 23 | #include "nodejs-parser/http_parser.c" 24 | 25 | #ifdef BOOST_MSVC 26 | # pragma warning (pop) 27 | #endif 28 | 29 | #if defined(__GNUC__) && (__GNUC__ >= 7) 30 | #pragma GCC diagnostic pop 31 | #endif 32 | -------------------------------------------------------------------------------- /include/boost/beast/version.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_VERSION_HPP 11 | #define BOOST_BEAST_VERSION_HPP 12 | 13 | #include 14 | #include 15 | 16 | //[version 17 | 18 | /* Identifies the API version of Beast. 19 | 20 | This is a simple integer that is incremented by one every 21 | time a set of code changes is merged to the develop branch. 22 | */ 23 | #define BOOST_BEAST_VERSION 359 24 | 25 | // A string describing BOOST_BEAST_VERSION, that can be used in http headers. 26 | #define BOOST_BEAST_VERSION_STRING "Boost.Beast/" BOOST_STRINGIZE(BOOST_BEAST_VERSION) 27 | 28 | //] 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /test/beast/ssl/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | local SOURCES = 11 | ssl_stream.cpp 12 | ; 13 | 14 | local RUN_TESTS ; 15 | 16 | for local f in $(SOURCES) 17 | { 18 | RUN_TESTS += [ run $(f) 19 | /boost/beast/test//lib-asio-ssl 20 | /boost/beast/test//lib-test 21 | ] ; 22 | } 23 | 24 | alias run-tests : $(RUN_TESTS) ; 25 | 26 | exe fat-tests 27 | : 28 | $(SOURCES) 29 | /boost/beast/test//lib-asio-ssl 30 | /boost/beast/test//lib-test 31 | ; 32 | 33 | explicit fat-tests ; 34 | 35 | run $(SOURCES) 36 | /boost/beast/test//lib-asio-ssl 37 | /boost/beast/test//lib-test 38 | : : : : run-fat-tests ; 39 | 40 | explicit run-fat-tests ; 41 | -------------------------------------------------------------------------------- /test/doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | file(GLOB_RECURSE PFILES CONFIGURE_DEPENDS Jamfile *.cpp *.ipp *.hpp) 12 | 13 | add_executable(boost_beast_tests_doc ${PFILES}) 14 | 15 | source_group("" FILES ${PFILES}) 16 | 17 | target_include_directories(boost_beast_tests_doc 18 | PRIVATE ${PROJECT_SOURCE_DIR}) 19 | 20 | target_link_libraries(boost_beast_tests_doc 21 | boost_beast_lib_asio_ssl 22 | boost_beast_lib_test) 23 | 24 | set_target_properties(boost_beast_tests_doc 25 | PROPERTIES FOLDER "tests") 26 | 27 | add_test(NAME boost_beast_tests_doc COMMAND boost_beast_tests_doc) 28 | add_dependencies(tests boost_beast_tests_doc) 29 | -------------------------------------------------------------------------------- /include/boost/beast/http/serializer_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_HTTP_SERIALIZER_FWD_HPP 11 | #define BOOST_BEAST_HTTP_SERIALIZER_FWD_HPP 12 | 13 | #include 14 | 15 | namespace boost { 16 | namespace beast { 17 | namespace http { 18 | 19 | #ifndef BOOST_BEAST_DOXYGEN 20 | template 21 | class serializer; 22 | 23 | template 24 | using request_serializer = serializer; 25 | 26 | template 27 | using response_serializer = serializer; 28 | #endif 29 | 30 | } // http 31 | } // beast 32 | } // boost 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /example/http/client/async-ssl-system-executor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(http-client-async-ssl-system-executor 12 | Jamfile 13 | http_client_async_ssl_system_executor.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | http_client_async_ssl_system_executor.cpp) 18 | 19 | target_include_directories(http-client-async-ssl-system-executor 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(http-client-async-ssl-system-executor 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(http-client-async-ssl-system-executor 26 | PROPERTIES FOLDER "example-http-client") 27 | -------------------------------------------------------------------------------- /include/boost/beast/http/dynamic_body.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_HTTP_DYNAMIC_BODY_HPP 11 | #define BOOST_BEAST_HTTP_DYNAMIC_BODY_HPP 12 | 13 | #include 14 | 15 | #include 16 | #include 17 | 18 | namespace boost { 19 | namespace beast { 20 | namespace http { 21 | 22 | #if BOOST_BEAST_DOXYGEN 23 | /** A dynamic message body represented by a @ref multi_buffer 24 | 25 | Meets the requirements of Body. 26 | */ 27 | using dynamic_body = basic_dynamic_body; 28 | #endif 29 | 30 | } // http 31 | } // beast 32 | } // boost 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | PLEASE DON'T FORGET TO "STAR" THIS REPOSITORY :) 2 | 3 | If you rather keep your project secret, feel free 4 | to email the author at ``; any 5 | private correspondence is treated as confidential. 6 | 7 | When reporting a bug please include the following: 8 | 9 | ### Version of Beast 10 | 11 | You can find the version number in the file ``, 12 | or by using the command "git log -1" in the local Beast repository 13 | directory. 14 | 15 | ### Steps necessary to reproduce the problem 16 | 17 | A small compiling program is the best. If your code is 18 | public, you can provide a link to the repository. 19 | 20 | ### All relevant compiler information 21 | 22 | If you are unable to compile please include the type and 23 | version of compiler you are using as well as all compiler 24 | output including the error message, file, and line numbers 25 | involved. 26 | 27 | The more information you provide the sooner your issue 28 | can get resolved! 29 | -------------------------------------------------------------------------------- /include/boost/beast/_experimental/test/impl/error.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_TEST_IMPL_ERROR_HPP 11 | #define BOOST_BEAST_TEST_IMPL_ERROR_HPP 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | namespace boost { 18 | namespace system { 19 | template<> 20 | struct is_error_code_enum< 21 | boost::beast::test::error> 22 | : std::true_type 23 | { 24 | }; 25 | } // system 26 | } // boost 27 | 28 | namespace boost { 29 | namespace beast { 30 | namespace test { 31 | 32 | BOOST_BEAST_DECL 33 | error_code 34 | make_error_code(error e) noexcept; 35 | 36 | } // test 37 | } // beast 38 | } // boost 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /include/boost/beast/http/parser_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_HTTP_PARSER_FWD_HPP 11 | #define BOOST_BEAST_HTTP_PARSER_FWD_HPP 12 | 13 | #include 14 | 15 | namespace boost { 16 | namespace beast { 17 | namespace http { 18 | 19 | #ifndef BOOST_BEAST_DOXYGEN 20 | template< 21 | bool isRequest, 22 | class Body, 23 | class Allocator = std::allocator> 24 | class parser; 25 | 26 | template> 27 | using request_parser = parser; 28 | 29 | template> 30 | using response_parser = parser; 31 | #endif 32 | 33 | } // http 34 | } // beast 35 | } // boost 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /include/boost/beast/core/tcp_stream.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_CORE_TCP_STREAM_HPP 11 | #define BOOST_BEAST_CORE_TCP_STREAM_HPP 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | namespace boost { 20 | namespace beast { 21 | 22 | /** A TCP/IP stream socket with timeouts and a polymorphic executor. 23 | 24 | @see basic_stream 25 | */ 26 | using tcp_stream = basic_stream< 27 | net::ip::tcp, 28 | net::any_io_executor, 29 | unlimited_rate_policy>; 30 | 31 | } // beast 32 | } // boost 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /test/beast/core/file_posix.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | 13 | #if BOOST_BEAST_USE_POSIX_FILE 14 | 15 | #include "file_test.hpp" 16 | 17 | #include 18 | 19 | namespace boost { 20 | namespace beast { 21 | 22 | BOOST_CORE_STATIC_ASSERT(! std::is_copy_constructible::value); 23 | 24 | class file_posix_test 25 | : public beast::unit_test::suite 26 | { 27 | public: 28 | void 29 | run() 30 | { 31 | test_file(); 32 | } 33 | }; 34 | 35 | BEAST_DEFINE_TESTSUITE(beast,core,file_posix); 36 | 37 | } // beast 38 | } // boost 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /example/websocket/client/async-ssl-system-executor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(websocket-client-async-ssl-system-executor 12 | Jamfile 13 | websocket_client_async_ssl_system_executor.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | websocket_client_async_ssl_system_executor.cpp) 18 | 19 | target_include_directories(websocket-client-async-ssl-system-executor 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(websocket-client-async-ssl-system-executor 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(websocket-client-async-ssl-system-executor 26 | PROPERTIES FOLDER "example-websocket-client") 27 | -------------------------------------------------------------------------------- /test/beast/zlib/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | local SOURCES = 11 | error.cpp 12 | deflate_stream.cpp 13 | inflate_stream.cpp 14 | zlib.cpp 15 | ; 16 | 17 | local RUN_TESTS ; 18 | 19 | for local f in $(SOURCES) 20 | { 21 | RUN_TESTS += [ run $(f) 22 | /boost/beast/test//lib-zlib 23 | /boost/beast/test//lib-test 24 | ] ; 25 | } 26 | 27 | alias run-tests : $(RUN_TESTS) ; 28 | 29 | exe fat-tests : 30 | $(SOURCES) 31 | /boost/beast/test//lib-zlib 32 | /boost/beast/test//lib-test 33 | ; 34 | 35 | explicit fat-tests ; 36 | 37 | run 38 | $(SOURCES) 39 | /boost/beast/test//lib-zlib 40 | /boost/beast/test//lib-test 41 | : : : : run-fat-tests ; 42 | 43 | explicit run-fat-tests ; 44 | -------------------------------------------------------------------------------- /include/boost/beast/core/detail/service_base.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_DETAIL_SERVICE_BASE_HPP 11 | #define BOOST_BEAST_DETAIL_SERVICE_BASE_HPP 12 | 13 | #include 14 | 15 | namespace boost { 16 | namespace beast { 17 | namespace detail { 18 | 19 | template 20 | struct service_base : net::execution_context::service 21 | { 22 | static net::execution_context::id const id; 23 | 24 | explicit 25 | service_base(net::execution_context& ctx) 26 | : net::execution_context::service(ctx) 27 | { 28 | } 29 | }; 30 | 31 | template 32 | net::execution_context::id const service_base::id; 33 | 34 | } // detail 35 | } // beast 36 | } // boost 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /test/beast/core/file_stdio.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | 13 | #include "file_test.hpp" 14 | 15 | #include 16 | 17 | namespace boost { 18 | namespace beast { 19 | 20 | BOOST_CORE_STATIC_ASSERT(! std::is_copy_constructible::value); 21 | 22 | class file_stdio_test 23 | : public beast::unit_test::suite 24 | { 25 | public: 26 | void 27 | run() 28 | { 29 | #ifdef BOOST_MSVC 30 | test_file(); 31 | #else 32 | test_file(); 33 | #endif 34 | } 35 | }; 36 | 37 | BEAST_DEFINE_TESTSUITE(beast,core,file_stdio); 38 | 39 | } // beast 40 | } // boost 41 | -------------------------------------------------------------------------------- /test/fuzz/http_response.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mikhail Khachayants 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | 8 | #include 9 | #include 10 | 11 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) 12 | { 13 | using namespace boost::beast; 14 | 15 | error_code ec; 16 | flat_buffer buffer; 17 | net::io_context ioc; 18 | test::stream stream{ioc, {reinterpret_cast(data), size}}; 19 | stream.close_remote(); 20 | 21 | http::chunk_extensions ce; 22 | http::response_parser parser; 23 | 24 | auto chunk_header_cb = [&ce](std::uint64_t, string_view extensions, error_code& ev) 25 | { 26 | ce.parse(extensions, ev); 27 | }; 28 | 29 | parser.on_chunk_header(chunk_header_cb); 30 | http::read(stream, buffer, parser, ec); 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /test/beast/_experimental/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | local SOURCES = 11 | _test_detail_stream_state.cpp 12 | error.cpp 13 | icy_stream.cpp 14 | stream.cpp 15 | ; 16 | 17 | local RUN_TESTS ; 18 | 19 | for local f in $(SOURCES) 20 | { 21 | RUN_TESTS += [ run $(f) 22 | /boost/beast/test//lib-asio-ssl 23 | /boost/beast/test//lib-test 24 | ] ; 25 | } 26 | 27 | alias run-tests : $(RUN_TESTS) ; 28 | 29 | exe fat-tests : 30 | $(SOURCES) 31 | /boost/beast/test//lib-asio-ssl 32 | /boost/beast/test//lib-test 33 | ; 34 | 35 | explicit fat-tests ; 36 | 37 | run $(SOURCES) 38 | /boost/beast/test//lib-asio-ssl 39 | /boost/beast/test//lib-test 40 | : : : : run-fat-tests ; 41 | 42 | explicit run-fat-tests ; 43 | -------------------------------------------------------------------------------- /include/boost/beast/core/impl/error.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_IMPL_ERROR_HPP 11 | #define BOOST_BEAST_IMPL_ERROR_HPP 12 | 13 | #include 14 | 15 | namespace boost { 16 | namespace system { 17 | template<> 18 | struct is_error_code_enum<::boost::beast::error> 19 | { 20 | static bool const value = true; 21 | }; 22 | template<> 23 | struct is_error_condition_enum<::boost::beast::condition> 24 | { 25 | static bool const value = true; 26 | }; 27 | } // system 28 | } // boost 29 | 30 | namespace boost { 31 | namespace beast { 32 | 33 | BOOST_BEAST_DECL 34 | error_code 35 | make_error_code(error e); 36 | 37 | BOOST_BEAST_DECL 38 | error_condition 39 | make_error_condition(condition c); 40 | 41 | } // beast 42 | } // boost 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /include/boost/beast/core/string_type.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_STRING_TYPE_HPP 11 | #define BOOST_BEAST_STRING_TYPE_HPP 12 | 13 | #include 14 | #include 15 | 16 | namespace boost { 17 | namespace beast { 18 | 19 | /// The type of string view used by the library 20 | using string_view = boost::core::string_view; 21 | 22 | /// The type of `basic_string_view` used by the library 23 | template 24 | using basic_string_view = 25 | boost::core::basic_string_view; 26 | 27 | template 28 | inline string_view 29 | to_string_view(const S& s) 30 | { 31 | return string_view(s.data(), s.size()); 32 | } 33 | 34 | } // beast 35 | } // boost 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /example/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | import testing ; 11 | import-search /boost/config/checks ; 12 | import config : requires ; 13 | 14 | project /boost/beast/example 15 | : requirements 16 | [ requires 17 | cxx11_constexpr 18 | cxx11_decltype 19 | cxx11_hdr_tuple 20 | #cxx11_sfinae_expr # Every MSVC fails this 21 | cxx11_template_aliases 22 | cxx11_variadic_templates 23 | ] 24 | /boost/beast/test//lib-asio/static 25 | on:/boost/beast/test//lib-beast/static 26 | .. 27 | ; 28 | 29 | build-project advanced ; 30 | build-project http ; 31 | build-project websocket ; 32 | 33 | build-project doc ; 34 | 35 | # legacy 36 | build-project echo-op ; 37 | -------------------------------------------------------------------------------- /test/beast/core/span.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | #include 17 | 18 | namespace boost { 19 | namespace beast { 20 | 21 | class span_test : public beast::unit_test::suite 22 | { 23 | public: 24 | void 25 | testSpan() 26 | { 27 | span sp{"hello", 5}; 28 | BEAST_EXPECT(sp.size() == 5); 29 | std::string s("world"); 30 | sp = s; 31 | } 32 | 33 | void 34 | run() override 35 | { 36 | testSpan(); 37 | } 38 | }; 39 | 40 | BEAST_DEFINE_TESTSUITE(beast,core,span); 41 | 42 | } // beast 43 | } // boost 44 | -------------------------------------------------------------------------------- /include/boost/beast/core/static_string.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_STATIC_STRING_HPP 11 | #define BOOST_BEAST_STATIC_STRING_HPP 12 | 13 | #include 14 | #include 15 | 16 | namespace boost { 17 | namespace beast { 18 | 19 | template > 22 | using static_string = boost::static_strings::basic_static_string; 24 | 25 | template 26 | inline auto 27 | to_static_string(Integer x) 28 | -> decltype(boost::static_strings::to_static_string(x)) 29 | { 30 | return boost::static_strings::to_static_string(x); 31 | } 32 | 33 | } // beast 34 | } // boost 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /include/boost/beast/websocket/detail/type_traits.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_WEBSOCKET_DETAIL_TYPE_TRAITS_HPP 11 | #define BOOST_BEAST_WEBSOCKET_DETAIL_TYPE_TRAITS_HPP 12 | 13 | #include 14 | #include 15 | 16 | namespace boost { 17 | namespace beast { 18 | namespace websocket { 19 | namespace detail { 20 | 21 | template 22 | using is_request_decorator = 23 | typename beast::detail::is_invocable::type; 25 | 26 | template 27 | using is_response_decorator = 28 | typename beast::detail::is_invocable::type; 30 | 31 | } // detail 32 | } // websocket 33 | } // beast 34 | } // boost 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /test/beast/_experimental/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(boost_beast_tests__experimental 12 | Jamfile 13 | _test_detail_stream_state.cpp 14 | error.cpp 15 | icy_stream.cpp 16 | stream.cpp) 17 | 18 | source_group("" FILES 19 | Jamfile 20 | _test_detail_stream_state.cpp 21 | error.cpp 22 | icy_stream.cpp 23 | stream.cpp) 24 | 25 | target_link_libraries(boost_beast_tests__experimental 26 | boost_beast_lib_asio_ssl 27 | boost_beast_lib_test) 28 | 29 | set_target_properties(boost_beast_tests__experimental 30 | PROPERTIES FOLDER "tests") 31 | 32 | add_test(NAME boost_beast_tests__experimental COMMAND boost_beast_tests__experimental) 33 | add_dependencies(tests boost_beast_tests__experimental) 34 | -------------------------------------------------------------------------------- /test/beast/core/_detail_clamp.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | namespace boost { 17 | namespace beast { 18 | namespace detail { 19 | 20 | class clamp_test : public beast::unit_test::suite 21 | { 22 | public: 23 | void testClamp() 24 | { 25 | BEAST_EXPECT(clamp( 26 | (std::numeric_limits::max)()) == 27 | (std::numeric_limits::max)()); 28 | } 29 | 30 | void run() override 31 | { 32 | testClamp(); 33 | } 34 | }; 35 | 36 | BEAST_DEFINE_TESTSUITE(beast,core,clamp); 37 | 38 | } // detail 39 | } // beast 40 | } // boost 41 | -------------------------------------------------------------------------------- /include/boost/beast/http/file_body.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_HTTP_FILE_BODY_HPP 11 | #define BOOST_BEAST_HTTP_FILE_BODY_HPP 12 | 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | namespace boost { 22 | namespace beast { 23 | namespace http { 24 | 25 | #if BOOST_BEAST_DOXYGEN 26 | /// A message body represented by a file on the filesystem. 27 | using file_body = basic_file_body; 28 | #endif 29 | 30 | } // http 31 | } // beast 32 | } // boost 33 | 34 | #ifndef BOOST_BEAST_NO_FILE_BODY_WIN32 35 | #include 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /doc/qbk/01_intro/1b_autobahn.qbk: -------------------------------------------------------------------------------- 1 | [/ 2 | Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | 4 | Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | Official repository: https://github.com/boostorg/beast 8 | ] 9 | 10 | [section:websocket_autobahn_testsuite WebSocket (Autobahn|Testsuite)] 11 | 12 | The 13 | [@https://github.com/crossbario/autobahn-testsuite Autobahn WebSockets Testsuite] 14 | provides a fully automated test suite to 15 | verify client and server implementations of The WebSocket Protocol 16 | for specification conformance and implementation robustness. 17 | The test suite will check an implementation by doing basic 18 | WebSocket conversations, extensive protocol compliance 19 | verification and performance and limits testing. 20 | Autobahn|Testsuite is used across the industry and 21 | contains over 500 test cases. 22 | 23 | [@https://vinniefalco.github.io/BeastAssets/reports/autobahn/index.html [*Autobahn|Testsuite WebSocket Results]] 24 | 25 | [endsect] 26 | -------------------------------------------------------------------------------- /cmake/toolchains/msvc.cmake: -------------------------------------------------------------------------------- 1 | # Include common options. 2 | include(${CMAKE_CURRENT_LIST_DIR}/common.cmake) 3 | 4 | # Static runtime linkage. 5 | set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>" CACHE STRING "") 6 | 7 | # Compiler options. 8 | # Specific to C and CXX, to prevent passing them to MASM 9 | add_compile_options( 10 | $<$:/bigobj> 11 | $<$:/permissive-> 12 | $<$:/W4> 13 | $<$:/MP> 14 | ) 15 | if("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Win32") # 32-bit 16 | add_compile_options( 17 | /arch:SSE2 18 | ) 19 | endif() 20 | 21 | # Linker options. 22 | add_link_options( 23 | ) 24 | 25 | # Disable logos. 26 | foreach(lang C CXX ASM_MASM RC) 27 | set(CMAKE_${lang}_FLAGS_INIT "/nologo") 28 | endforeach() 29 | foreach(type EXE SHARED MODULE) 30 | set(CMAKE_${type}_LINKER_FLAGS_INIT "/nologo") 31 | endforeach() 32 | 33 | # Silence Visual Studio CMake integration warnings. 34 | set(SILENCE_VS_DEFINITIONS ${CMAKE_TOOLCHAIN_FILE} ${CMAKE_C_COMPILER}) 35 | set(SILENCE_VS_DEFINITIONS) 36 | -------------------------------------------------------------------------------- /include/boost/beast/core/detail/string.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_DETAIL_STRING_HPP 11 | #define BOOST_BEAST_DETAIL_STRING_HPP 12 | 13 | #include 14 | 15 | namespace boost { 16 | namespace beast { 17 | 18 | namespace detail { 19 | 20 | // Pulling in the UDL directly breaks in some places on MSVC, 21 | // so introduce a namespace for this purprose. 22 | namespace string_literals { 23 | 24 | inline 25 | string_view 26 | operator""_sv(char const* p, std::size_t n) 27 | { 28 | return string_view{p, n}; 29 | } 30 | 31 | } // string_literals 32 | 33 | inline 34 | char 35 | ascii_tolower(char c) 36 | { 37 | return ((static_cast(c) - 65U) < 26) ? 38 | c + 'a' - 'A' : c; 39 | } 40 | } // detail 41 | } // beast 42 | } // boost 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /test/beast/zlib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(boost_beast_tests_zlib 12 | Jamfile 13 | error.cpp 14 | deflate_stream.cpp 15 | inflate_stream.cpp 16 | zlib.cpp) 17 | 18 | source_group("" FILES 19 | Jamfile 20 | error.cpp 21 | deflate_stream.cpp 22 | inflate_stream.cpp 23 | zlib.cpp) 24 | 25 | target_include_directories(boost_beast_tests_zlib 26 | PRIVATE ${PROJECT_SOURCE_DIR}/test/extern) 27 | 28 | target_link_libraries(boost_beast_tests_zlib 29 | boost_beast_lib_test 30 | boost_beast_lib_zlib) 31 | 32 | set_target_properties(boost_beast_tests_zlib 33 | PROPERTIES FOLDER "tests") 34 | 35 | add_test(NAME boost_beast_tests_zlib COMMAND boost_beast_tests_zlib) 36 | add_dependencies(tests boost_beast_tests_zlib) 37 | -------------------------------------------------------------------------------- /test/example/common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(boost_beast_tests_example_common 12 | Jamfile 13 | root_certificates.cpp 14 | server_certificate.cpp) 15 | 16 | source_group("" FILES 17 | Jamfile 18 | root_certificates.cpp 19 | server_certificate.cpp) 20 | 21 | target_include_directories(boost_beast_tests_example_common 22 | PRIVATE ${PROJECT_SOURCE_DIR}) 23 | 24 | target_link_libraries(boost_beast_tests_example_common 25 | boost_beast_lib_asio_ssl 26 | boost_beast_lib_test) 27 | 28 | set_target_properties(boost_beast_tests_example_common 29 | PROPERTIES FOLDER "tests") 30 | 31 | add_test(NAME boost_beast_tests_example_common COMMAND boost_beast_tests_example_common) 32 | add_dependencies(tests boost_beast_tests_example_common) 33 | -------------------------------------------------------------------------------- /include/boost/beast/websocket/impl/error.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_WEBSOCKET_IMPL_ERROR_HPP 11 | #define BOOST_BEAST_WEBSOCKET_IMPL_ERROR_HPP 12 | 13 | namespace boost { 14 | namespace system { 15 | template<> 16 | struct is_error_code_enum<::boost::beast::websocket::error> 17 | { 18 | static bool const value = true; 19 | }; 20 | template<> 21 | struct is_error_condition_enum<::boost::beast::websocket::condition> 22 | { 23 | static bool const value = true; 24 | }; 25 | } // system 26 | } // boost 27 | 28 | namespace boost { 29 | namespace beast { 30 | namespace websocket { 31 | 32 | BOOST_BEAST_DECL 33 | error_code 34 | make_error_code(error e); 35 | 36 | BOOST_BEAST_DECL 37 | error_condition 38 | make_error_condition(condition c); 39 | 40 | } // websocket 41 | } // beast 42 | } // boost 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /test/beast/http/vector_body.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | 13 | #include 14 | 15 | #include 16 | 17 | namespace boost { 18 | namespace beast { 19 | namespace http { 20 | 21 | BOOST_CORE_STATIC_ASSERT(is_body>::value); 22 | BOOST_CORE_STATIC_ASSERT(is_body_writer>::value); 23 | BOOST_CORE_STATIC_ASSERT(is_body_reader>::value); 24 | 25 | #if __cpp_lib_byte >= 201603 26 | BOOST_CORE_STATIC_ASSERT(is_body>::value); 27 | BOOST_CORE_STATIC_ASSERT(is_body_writer>::value); 28 | BOOST_CORE_STATIC_ASSERT(is_body_reader>::value); 29 | #endif 30 | 31 | } // http 32 | } // beast 33 | } // boost 34 | -------------------------------------------------------------------------------- /include/boost/beast/core/detail/allocator.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_DETAIL_ALLOCATOR_HPP 11 | #define BOOST_BEAST_DETAIL_ALLOCATOR_HPP 12 | 13 | #include 14 | #ifdef BOOST_NO_CXX11_ALLOCATOR 15 | #include 16 | #else 17 | #include 18 | #endif 19 | 20 | namespace boost { 21 | namespace beast { 22 | namespace detail { 23 | 24 | // This is a workaround for allocator_traits 25 | // implementations which falsely claim C++11 26 | // compatibility. 27 | 28 | #ifdef BOOST_NO_CXX11_ALLOCATOR 29 | template 30 | using allocator_traits = boost::container::allocator_traits; 31 | 32 | #else 33 | template 34 | using allocator_traits = std::allocator_traits; 35 | 36 | #endif 37 | 38 | } // detail 39 | } // beast 40 | } // boost 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /test/beast/core/buffers_to_string.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | // Test that header file is self-contained. 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | namespace boost { 18 | namespace beast { 19 | 20 | class buffers_to_string_test : public unit_test::suite 21 | { 22 | public: 23 | void 24 | run() override 25 | { 26 | multi_buffer b; 27 | ostream(b) << "Hello, "; 28 | BEAST_EXPECT(buffers_to_string(b.data()) == "Hello, "); 29 | ostream(b) << "world!"; 30 | BEAST_EXPECT(buffers_to_string(b.data()) == "Hello, world!"); 31 | } 32 | }; 33 | 34 | BEAST_DEFINE_TESTSUITE(beast,core,buffers_to_string); 35 | 36 | } // beast 37 | } // boost 38 | -------------------------------------------------------------------------------- /include/boost/beast/_experimental/test/error.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_TEST_ERROR_HPP 11 | #define BOOST_BEAST_TEST_ERROR_HPP 12 | 13 | #include 14 | #include 15 | 16 | namespace boost { 17 | namespace beast { 18 | namespace test { 19 | 20 | /// Error codes returned from unit testing algorithms 21 | enum class error 22 | { 23 | /** The test stream generated a simulated testing error 24 | 25 | This error is returned by a @ref fail_count object 26 | when it generates a simulated error. 27 | */ 28 | test_failure = 1 29 | }; 30 | 31 | } // test 32 | } // beast 33 | } // boost 34 | 35 | #include 36 | #ifdef BOOST_BEAST_HEADER_ONLY 37 | #include 38 | #endif 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /example/doc/ssl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2025 Mohammad Nejati 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | # Client 11 | add_executable(doc-ssl-client 12 | Jamfile 13 | client.cpp) 14 | 15 | source_group("" FILES 16 | Jamfile 17 | client.cpp) 18 | 19 | target_include_directories(doc-ssl-client 20 | PRIVATE ${PROJECT_SOURCE_DIR}) 21 | 22 | target_link_libraries(doc-ssl-client 23 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 24 | 25 | set_target_properties(doc-ssl-client 26 | PROPERTIES FOLDER "example-doc-ssl") 27 | 28 | # Server 29 | add_executable(doc-ssl-server 30 | Jamfile 31 | server.cpp) 32 | 33 | source_group("" FILES 34 | Jamfile 35 | server.cpp) 36 | 37 | target_include_directories(doc-ssl-server 38 | PRIVATE ${PROJECT_SOURCE_DIR}) 39 | 40 | target_link_libraries(doc-ssl-server 41 | PRIVATE Boost::beast OpenSSL::SSL OpenSSL::Crypto) 42 | 43 | set_target_properties(doc-ssl-server 44 | PROPERTIES FOLDER "example-doc-ssl") 45 | -------------------------------------------------------------------------------- /include/boost/beast/http/message_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2024 Mohammad Nejati 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_HTTP_MESSAGE_FWD_HPP 11 | #define BOOST_BEAST_HTTP_MESSAGE_FWD_HPP 12 | 13 | #include 14 | 15 | namespace boost { 16 | namespace beast { 17 | namespace http { 18 | 19 | #ifndef BOOST_BEAST_DOXYGEN 20 | template 21 | class header; 22 | 23 | template 24 | class message; 25 | 26 | template 27 | using request_header = header; 28 | 29 | template 30 | using response_header = header; 31 | 32 | template 33 | using request = message; 34 | 35 | template 36 | using response = message; 37 | #endif 38 | 39 | } // http 40 | } // beast 41 | } // boost 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /include/boost/beast/websocket/impl/rfc6455.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_WEBSOCKET_IMPL_RFC6455_HPP 11 | #define BOOST_BEAST_WEBSOCKET_IMPL_RFC6455_HPP 12 | 13 | #include 14 | #include 15 | 16 | namespace boost { 17 | namespace beast { 18 | namespace websocket { 19 | 20 | template 21 | bool 22 | is_upgrade(http::header> const& req) 24 | { 25 | if(req.version() < 11) 26 | return false; 27 | if(req.method() != http::verb::get) 28 | return false; 29 | if(! http::token_list{req[http::field::connection]}.exists("upgrade")) 30 | return false; 31 | if(! http::token_list{req[http::field::upgrade]}.exists("websocket")) 32 | return false; 33 | return true; 34 | } 35 | 36 | } // websocket 37 | } // beast 38 | } // boost 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /include/boost/beast/core/impl/flat_static_buffer.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_IMPL_FLAT_STATIC_BUFFER_HPP 11 | #define BOOST_BEAST_IMPL_FLAT_STATIC_BUFFER_HPP 12 | 13 | namespace boost { 14 | namespace beast { 15 | 16 | template 17 | flat_static_buffer:: 18 | flat_static_buffer( 19 | flat_static_buffer const& other) 20 | : flat_static_buffer_base(buf_, N) 21 | { 22 | this->commit(net::buffer_copy( 23 | this->prepare(other.size()), other.data())); 24 | } 25 | 26 | template 27 | auto 28 | flat_static_buffer:: 29 | operator=(flat_static_buffer const& other) -> 30 | flat_static_buffer& 31 | { 32 | if(this == &other) 33 | return *this; 34 | this->consume(this->size()); 35 | this->commit(net::buffer_copy( 36 | this->prepare(other.size()), other.data())); 37 | return *this; 38 | } 39 | 40 | } // beast 41 | } // boost 42 | 43 | #endif -------------------------------------------------------------------------------- /test/beast/Jamfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | # 7 | # Official repository: https://github.com/boostorg/beast 8 | # 9 | 10 | alias run-tests : 11 | [ compile core.cpp ] 12 | [ compile http.cpp ] 13 | [ compile ssl.cpp /boost/beast/test//lib-asio-ssl ] 14 | [ compile version.cpp ] 15 | [ compile websocket.cpp ] 16 | [ compile zlib.cpp ] 17 | _experimental//run-tests 18 | core//run-tests 19 | http//run-tests 20 | ssl//run-tests 21 | websocket//run-tests 22 | zlib//run-tests 23 | ; 24 | 25 | alias fat-tests : 26 | _experimental//fat-tests 27 | core//fat-tests 28 | http//fat-tests 29 | ssl//fat-tests 30 | websocket//fat-tests 31 | zlib//fat-tests 32 | ; 33 | 34 | explicit fat-tests ; 35 | 36 | alias run-fat-tests : 37 | _experimental//run-fat-tests 38 | core//run-fat-tests 39 | http//run-fat-tests 40 | ssl//run-fat-tests 41 | websocket//run-fat-tests 42 | zlib//run-fat-tests 43 | ; 44 | 45 | explicit run-fat-tests ; 46 | -------------------------------------------------------------------------------- /include/boost/beast/core/file.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2015-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_CORE_FILE_HPP 11 | #define BOOST_BEAST_CORE_FILE_HPP 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | namespace boost { 20 | namespace beast { 21 | 22 | /** An implementation of File. 23 | 24 | This alias is set to the best available implementation 25 | of File given the platform and build settings. 26 | */ 27 | #if BOOST_BEAST_DOXYGEN 28 | struct file : file_stdio 29 | { 30 | }; 31 | #else 32 | #if BOOST_BEAST_USE_WIN32_FILE 33 | using file = file_win32; 34 | #elif BOOST_BEAST_USE_POSIX_FILE 35 | using file = file_posix; 36 | #else 37 | using file = file_stdio; 38 | #endif 39 | #endif 40 | 41 | } // beast 42 | } // boost 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /example/websocket/server/chat-multi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | # Copyright (c) 2024 Mohammad Nejati 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | # 8 | # Official repository: https://github.com/boostorg/beast 9 | # 10 | 11 | add_executable(websocket-chat-multi 12 | beast.hpp 13 | chat_client.html 14 | http_session.cpp 15 | http_session.hpp 16 | Jamfile 17 | listener.cpp 18 | listener.hpp 19 | main.cpp 20 | net.hpp 21 | shared_state.cpp 22 | shared_state.hpp 23 | websocket_session.cpp 24 | websocket_session.hpp) 25 | 26 | source_group("" FILES 27 | beast.hpp 28 | chat_client.html 29 | http_session.cpp 30 | http_session.hpp 31 | Jamfile 32 | listener.cpp 33 | listener.hpp 34 | main.cpp 35 | net.hpp 36 | shared_state.cpp 37 | shared_state.hpp 38 | websocket_session.cpp 39 | websocket_session.hpp) 40 | 41 | target_link_libraries(websocket-chat-multi PRIVATE Boost::beast) 42 | 43 | set_target_properties(websocket-chat-multi 44 | PROPERTIES FOLDER "example-websocket-server") 45 | -------------------------------------------------------------------------------- /include/boost/beast/core/impl/static_buffer.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // Official repository: https://github.com/boostorg/beast 8 | // 9 | 10 | #ifndef BOOST_BEAST_IMPL_STATIC_BUFFER_HPP 11 | #define BOOST_BEAST_IMPL_STATIC_BUFFER_HPP 12 | 13 | #include 14 | #include 15 | 16 | namespace boost { 17 | namespace beast { 18 | 19 | template 20 | static_buffer:: 21 | static_buffer(static_buffer const& other) noexcept 22 | : static_buffer_base(buf_, N) 23 | { 24 | this->commit(net::buffer_copy( 25 | this->prepare(other.size()), other.data())); 26 | } 27 | 28 | template 29 | auto 30 | static_buffer:: 31 | operator=(static_buffer const& other) noexcept -> 32 | static_buffer& 33 | { 34 | if(this == &other) 35 | return *this; 36 | this->consume(this->size()); 37 | this->commit(net::buffer_copy( 38 | this->prepare(other.size()), other.data())); 39 | return *this; 40 | } 41 | 42 | } // beast 43 | } // boost 44 | 45 | #endif 46 | --------------------------------------------------------------------------------