Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
e34d418
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
3440f7e
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
2c646c8
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
761137b
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
24f35c9
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
69120f4
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
20d4e87
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
45e0d65
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
42411d9
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
e2e6955
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
7939b87
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
9f69a9d
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
fc7502a
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
6e85ff2
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
25ae2b5
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
0d60c8b
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
8f85c53
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
5e88351
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
88ad00c
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
a0952c6
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
e5ac301
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
d55c927
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
4417d2b
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
74c45ff
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
eb9d87c
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
cbe766b
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
4e6bc35
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
e8639b1
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
1042aa4
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
f072ea6
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
c0f8e9f
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
5b3a305
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
b596e90
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
ca199d2
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
c3fefec
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
555c81c
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
cb29495
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
34ff3ea
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
11534cc
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
3182f65
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
9d11a56
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
bb3b21a
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
d8d2d7a
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
d8808d0
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
af48742
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
e41717e
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
07736df
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
beb711c
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
b105116
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
2fdd058
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
1bdbc45
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
2d98f3a
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
7742454
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
4a28767
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
c7c822a
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
7d68b89
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
d644386
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
02e56d8
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
a25c336
Added translation using Weblate (Chinese (Simplified Han script))
will-cppa Jun 5, 2026
877f3bc
Translated using Weblate (Chinese (Simplified Han script))
myzhang-1127 Jun 10, 2026
4ea6703
Translated using Weblate (Chinese (Simplified Han script))
Jun 11, 2026
8224ba5
Translated using Weblate (Chinese (Simplified Han script))
Jun 11, 2026
18fcd61
Translated using Weblate (Chinese (Simplified Han script))
Jun 11, 2026
0d7ea51
Translated using Weblate (Chinese (Simplified Han script))
Jun 11, 2026
03fc908
Translated using Weblate (Chinese (Simplified Han script))
Jun 11, 2026
e2d25df
Translated using Weblate (Chinese (Simplified Han script))
Jun 11, 2026
0e21f27
Translated using Weblate (Chinese (Simplified Han script))
Jun 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions doc/qbk/01_intro/1_quick_look_zh_Hans.qbk
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[/
Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)

Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Official repository: https://github.com/boostorg/beast
]

[section:quick_start 快速查看]
[/block'''<?dbhtml stop-chunking?>''']

这些完整示例程序旨在让读者快速了解该库的特点。它们的源码和编译脚本位于 [path_link example example] 目录中。



[section:http_client 简单HTTP客户端 __示例__]

使用 HTTP 向网站发送 GET 请求,然后打印返回结果:

文件:[path_link example/http/client/sync/http_client_sync.cpp http_sync_client.cpp]

[example_http_client]

[endsect]



[section:websocket_client 简单 WebSocket 客户端 __示例__]

建立 WebSocket 连接,发送消息并接收回复:

文件:[path_link example/websocket/client/sync/websocket_client_sync.cpp websocket_sync_client.cpp]

[example_websocket_client]

[endsect]

[include 1a_bishop_fox.qbk]

[include 1b_autobahn.qbk]

[endsect]
36 changes: 36 additions & 0 deletions doc/qbk/01_intro/1a_bishop_fox_zh_Hans.qbk
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[/
Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)

Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Official repository: https://github.com/boostorg/beast
]

[section:security_review_bishop_fox 安全审查(Bishop Fox)__视频__]

2020年,为了兑现打造应用开发者可以信赖的顶级 C++ 库这一承诺,C++ 联盟再次委托 Bishop Fox 对 Beast 库进行复测。

报告链接如下:

[@https://github.com/CPPAlliance/beast-assets/raw/master/bishop-fox/C%20Plus%20Plus%20Alliance%20-%20Hybrid%20Application%20Assessment%202020%20-%20Assessment%20Report%20-%2020200924.pdf
[*Beast - Hybrid Application Assessment 2020]]

自 2005 年起,[@https://www.bishopfox.com/ Bishop Fox] 一直为全球财富 1000 强、高科技初创公司及金融机构提供安全咨询服务。Beast 委托 Bishop Fox 对 Boost C++ Beast HTTP/S 网络库进行安全评估。本次评估自 2017 年 9 月 11 日开始,以下报告详细说明了评估过程中的各项发现。

评估团队对 Beast 库进行了混合式应用安全评估。Bishop Fox 的这套评估方法结合了渗透测试中的实际攻击手段和针对性的源码审查,可以全面发现应用安全漏洞。这类在充分了解系统内部情况的前提下进行的评估,先从已部署的应用和源码入手,做自动化扫描。接着,把扫描结果和人工审查结合起来,深入排查潜在的安全漏洞。另外,团队还对应用架构和业务逻辑进行审查,找出设计层面的问题。最后,团队对这些问题进行人工利用和验证,确认发现结果是否准确。

[@https://github.com/CPPAlliance/beast-assets/raw/master/bishop-fox/Beast%20-%20Hybrid%20Application%20Assessment%202017%20-%20Assessment%20Report%20-%2020171114.pdf
[*Beast - Hybrid Application Assessment 2017]]

[/ "Securing Boost.Beast: A Non-Traditional Source Code Review"]
'''
<mediaobject>
<videoobject>
<videodata fileref="https://www.youtube.com/embed/4TtyYbGDAj0?rel=0"
align="center" contentwidth="560" contentdepth="315"/>
</videoobject>
</mediaobject>
'''

[endsect]
16 changes: 16 additions & 0 deletions doc/qbk/01_intro/1b_autobahn_zh_Hans.qbk
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[/
Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)

Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Official repository: https://github.com/boostorg/beast
]

[section:websocket_autobahn_testsuite WebSocket(Autobahn| 测试套件)]

[@https://github.com/crossbario/autobahn-testsuite Autobahn WebSockets 测试套件] 提供了一套全自动化的测试方案,用于验证 WebSocket 协议的客户端和服务端实现是否符合规范、是否健壮。该测试套件通过基本的 WebSocket 通信、全面的协议合规性验证以及性能和极限测试来检查具体实现。Autobahn 测试套件在行业中得到广泛应用,包含 500 多个测试用例。

[@https://vinniefalco.github.io/BeastAssets/reports/autobahn/index.html [*Autobahn|Testsuite WebSocket Results]]

[endsect]
93 changes: 93 additions & 0 deletions doc/qbk/01_intro/_intro_zh_Hans.qbk
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
[/
Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)

Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Official repository: https://github.com/boostorg/beast
]

[section 引言]
[block'''<?dbhtml stop-chunking?>''']

Beast 是一个 C++ 仅头文件库,通过使用 __Asio__ 的统一异步模型提供 [*低级 HTTP/1、WebSocket 和网络协议*] 的词汇类型与算法,为编写可互操作的网络库奠定基础。

该库专为以下场景设计:

* **【对称性:】** 算法不区分角色;既可用来构建客户端,也可用来构建服务器,或者两者兼备。

* **【易用性:】** __Asio__ 用户能够立即理解 Beast。

* **【灵活性:】** 用户做出重要决策,例如缓冲区或
thread management.

* **【性能:】** 构建能够处理成千上万甚至更多连接的应用程序。

* **【作为进一步抽象的基础:】** 组件非常适合在其基础上进行构建。

该库本身并非客户端或服务器,但可用于构建这些组件。库中提供了大量示例,包括客户端和服务器的实现,可作为用户编写自己程序的起点。

[heading 动机]

Beast 授权用户基于 HTTP/1 和 WebSocket 构建自己的库、客户端及服务器。由于 Beast 处理了底层协议细节,代码的实现、理解与维护将变得更为简单和高效。HTTP 与 WebSocket 协议是万维网的核心协议。每个 Web 浏览器都实现这些协议以加载网页,并支持客户端程序(通常以 JavaScript 编写)进行交互通信。C++ 能够拥有这些协议的标准化实现,是一大助益。



[section 要求]

[important
该库面向熟悉 Asio 的程序员。用户
wish to use asynchronous interfaces should already know how to
create concurrent network programs using callbacks or coroutines.
]

Beast 依赖一下环境:

* **【C++11:】** 对大部分语言特性提供稳定支持。
* **【Boost:】** Beast 仅可与 Boost 一同使用,不支持独立版 Asio。
* **【OpenSSL:】**要求版本不低于 1.0.2。构建测试、示例以及使用 TLS/安全套接字时均需此依赖。

已在以下编译器上完成测试:msvc-14+、gcc 5.0+、clang 3.6+。

源码采用 [*仅头文件] 形式。通常情况下,在程序的链接阶段无需额外添加库即可使用 Beast,但以下情况除外:

* 当使用通过调用 [@boost:/doc/html/boost_asio/reference/spawn.html `boost::asio::spawn`] 创建的协程时,需要在程序中添加 [@boost:/libs/coroutine/index.html Boost.Coroutine] 库。

当使用 [@boost:/doc/html/boost_asio/reference/ssl__stream.html boost::asio::ssl::stream] 时,需要在程序中添加 [@https://www.openssl.org/ OpenSSL] 库。

请查阅 [@boost:/more/getting_started.html Boost 文档],以获取针对您特定环境系统构建和链接 Boost 库的说明。

[endsect]



[section 反馈缺陷]

如需报告缺陷或获取 Beast 的使用帮助,建议优先使用 GitHub Issues。请访问 [@https://github.com/boostorg/beast/issues https://github.com/boostorg/beast/issues] 提出问题、报告缺陷或请求新功能。如需对问题或咨询内容保密,请通过邮件联系作者:[@mailto:vinnie.falco%40gmail.com vinnie.falco@gmail.com]。

[endsect]



[section 致谢]

Boost.Asio 是所有接口与实现策略构建的基础。文档中的部分内容在措辞与呈现方式上参照了 Boost.Asio 文档的风格。感谢 [@https://github.com/chriskohlhoff Christopher Kohlhoff] 贡献了出色的 Asio 库,以及 [@http://cplusplus.github.io/networking-ts/draft.pdf [*C++ 网络扩展]] 中的设计思想,为 Beast 提供了核心动力。

Beast 的诞生离不开 [@https://www.ripple.com Ripple] 在其早期开发阶段提供的支持,也得益于 [@https://github.com/JoelKatz David Schwartz]、[@https://github.com/ximinez Edward Hennis]、[@https://github.com/howardhinnant Howard Hinnant]、[@https://github.com/miguelportilla Miguel Portilla]、[@https://github.com/nbougalis Nik Bougalis]、[@https://github.com/seelabs Scott Determan] 和 [@https://github.com/scottschurr Scott Schurr] 贡献的思路、时间与耐心。同时感谢 [@https://github.com/K-ballo Agustín Bergé]、[@http://www.boost.org/users/people/glen_fernandes.html Glen Fernandes] 及 [@https://github.com/pdimov Peter Dimov] 在 [@https://slack.cpp.al/ C++ Language Slack Workspace] 上不厌其烦地解答疑问。

感谢 [@https://github.com/djarek Damian Jarek] 的积极参与和源码贡献。

感谢 [@https://github.com/madmongo1 Richard Hodges] (hodges.r@gmail.com) 代表 [@https://cppalliance.org C++ 联盟] 维护 Beast 库。

非常感谢 [@https://www.jetbrains.com Jetbrains s.r.o.] 为 Beast 开发团队提供全套产品开发授权。
[endsect]



[endsect]

[h1 文档]

请访问 [@https://boost.org/libs/beast https://boost.org/libs/beast] 查看完整文档。

[include 1_quick_look.qbk]
Loading
Loading