2
0
mirror of https://github.com/boostorg/beast.git synced 2026-01-19 04:02:10 +00:00

95 Commits

Author SHA1 Message Date
Mohammad Nejati
e0884660f4 Add examples of Unix domain sockets
Closes #2918
2025-02-28 16:38:36 +03:30
Mohammad Nejati
ee2b5b2ff9 Replace SSL_set1_host with asio::ssl::host_name_verification
`SSL_set1_host` fails when host is an IP address
2025-02-13 20:09:44 +03:30
Mohammad Nejati
ea38d841b0 SSL examples verify peer cert hostname
Fixes #2974
2025-02-11 19:43:58 +03:30
Mohammad Nejati
827ecf5e93 Organize source files in CMakeLists with source_group 2024-11-25 11:41:40 +03:30
Mohammad Nejati
75e45287fb Refactor CMakeLists
Closes #2471
Closes #1816
2024-11-25 11:41:40 +03:30
Mohammad Nejati
7ce0ebe47c Fix warnings in json_client example 2024-09-19 15:27:57 +03:30
Mohammad Nejati
3ddcf4ed38 Jamfile cleanup 2024-09-04 22:37:14 +03:30
Mohammad Nejati
a9121c259b boost_json links` statically 2024-09-01 12:40:33 +03:30
René Ferdinand Rivera Morell
2bda7870fe Add support for modular build structure. (#2905)
* Use beast exclusive valgrind feature.

* Make the library modular usable.

* Switch to library requirements instead of source. As source puts extra source in install targets.

* Add Beast root dir for includes. As some tests refer to files relative to that.

* Replace relative docca refs with project based.

* Avoid mtuliple openssl configurations.

* Always declare openssl. If it's empty and duplicate it will be ignored.

* Add missing import-search for cconfig/predef checks.

* Add requires-b2 check to top-level build file.

* Bump B2 require to 5.2

* Update copyright dates.

* Move inter-lib dependencies to a project variable and into the build targets.

* Update build deps.

* Update build deps.

* The http/client/body example uses the source header from json instead of the linked library.
2024-09-01 11:26:02 +03:30
Mohammad Nejati
ff5672ec07 awaitable examples are simplified
No need for `rebind_executor` as `asio::deferred` is now the default completion token.
2024-07-07 14:58:49 +03:30
Mohammad Nejati
03b792faac net::ssl::stream is canonical in examples
We no longer need to use beast::ssl_stream to improve write performance, as
Asio now linearizes scatter/gather I/O in ssl::stream:
17637a48cc
2024-05-31 16:45:52 +03:30
Mohammad Nejati
bd804b6520 ssl_stream does not use flat_stream
We no longer need to use flat_stream to improve write performance, as
Asio now linearizes scatter/gather I/O in ssl::stream:
17637a48cc
2024-05-31 16:45:52 +03:30
Mohammad Nejati
6dd3cf7ab1 std::bind is superfluous in some examples 2024-05-31 16:45:52 +03:30
Mohammad Nejati
9bf2184b33 Fix error handling in SSL shutdown operations in examples 2024-05-28 23:39:48 +03:30
Klemens
0e5cf9ff79 awaitable-ssl example belongs to right directory
Closes #2654
2023-03-22 16:11:06 +08:00
Klemens Morgenstern
2bd65b27e1 awaitable server close fix.
Closes #2637
2023-02-20 13:58:07 +08:00
Klemens
99bceb5bff examples & tests use context instead of coroutine. 2023-02-02 23:27:49 +08:00
Klemens
1841a592d6 Minimalistic method examples. 2023-02-02 15:05:11 +08:00
Klemens Morgenstern
947b225c9e No unused function in awaitable examples. (#2605)
* No unused function in awaitable examples.
* Beast has an awaitable-ssl example.

Closes #2604.
2023-01-24 09:55:05 +08:00
Greg Glover
6e1eb76b1d typo in the json client comment 2022-12-07 13:42:03 +08:00
Klemens Morgenstern
09bfca1fa1 awaitable examples.
Closes #2104.
2022-10-30 00:13:54 +08:00
Klemens
4f5ec46002 Exampe CMakeLists.txt is fixed. 2022-10-04 09:17:56 +08:00
Klemens Morgenstern
12c2d14ebc streaming JSON body is an example 2022-10-03 09:53:05 +08:00
sehe
87ddb16151 Examples use http::message_generator 2022-05-21 22:12:13 -07:00
Daniel Engelke
9201210d5e fields_alloc does not leak
fix #2431, close #2432
2022-05-21 18:15:33 -07:00
Hreniuc Cristian-Alexandru
2f4506dc37 Fix accept error handling in http_server_async example
close #2319
2021-11-03 18:39:42 +01:00
Richard Hodges
70bddce07f Fix warning in http-server-fast 2021-03-16 10:03:25 +01:00
Richard Hodges
fae4c0e3c2 Parenthesise all uses of min() and max() 2021-03-16 10:02:47 +01:00
Richard Hodges
f036077547 Fix race in http-crawl 2020-07-07 18:49:35 +02:00
Richard Hodges
a9b5bf343d Examples require tracked 2020-07-04 08:22:57 +02:00
Richard Hodges
de1e63c597 Fix style errors 2020-07-04 08:12:10 +02:00
Richard Hodges
060f59685c Support BOOST_ASIO_NO_TS_EXECUTORS 2020-07-04 07:35:14 +02:00
Christopher Kohlhoff
55302a3f8f New name for polymorphic executor. Trait for detecting new executors 2020-07-04 07:34:34 +02:00
Richard Hodges
14c3d50b57 Deprecate string_param (API Change):
API Changes:

`string_param`, which was previously the argument type when setting field values
has been replaced by `string_view`. Because of this, it is no longer possible to
set message field values directly as integrals.

Users are required to convert numeric arguments to a string type prior to calling
`fields::set` et. al.

Beast provides the non-allocating `to_static_string()` function for this purpose.

To set Content-Length field manually, call `message::content_length`.

fixes #1956
2020-06-12 17:33:20 +02:00
Richard Hodges
7ce6980042 fix strand use in example
fixes #1822
close #1823
2020-01-28 10:26:42 +01:00
Vinnie Falco
5521b91d8c Tidy up cmake files and examples 2019-10-06 08:04:22 -07:00
Damian Jarek
3817fb4c94 Fix data race in http server examples
When using `beast::tcp_stream`, the user must make sure that async operations
are initiated from within the strand associated with the stream.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-06 07:52:13 -07:00
Damian Jarek
9170a0daaa Add async-ssl-system-executor http client example
This example HTTP client application uses the `system_executor` to show
how to use it with the I/O objects in ASIO and Beast.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-06 07:52:13 -07:00
Damian Jarek
8d5bd286d7 Replace uses of net::spawn with asio::spawn
`asio::spawn` is an extension, which is not part of
the Networking TS, so the `net` alias is not appropriate in this case.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-06-19 17:53:35 +02:00
Damian Jarek
f10dc38ae6 Replace uses of net::coroutine with asio::coroutine
`asio::coroutine` is an extension, which is not part of
the Networking TS, so the `net` alias is not appropriate in this case.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-06-19 17:53:35 +02:00
Damian Jarek
d0b0ab8961 Remove redundant dependencies in http/server/fast example
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-27 20:18:21 +02:00
Filip Matzner
1501962b92 Use steady_timer type
close #1606
2019-05-20 15:34:21 +02:00
Eelis van der Weegen
9b10f08692 detect_ssl uses bool
close #1568
2019-04-15 08:21:46 -07:00
Vinnie Falco
4e90183bda Check defined(BOOST_MSVC) 2019-03-29 20:42:44 -07:00
Vinnie Falco
61fcd9ef6f Refactor Jamfiles to work with release layout 2019-03-24 09:18:02 -07:00
Vinnie Falco
b38901887b cmake: Use static libs to speed up builds 2019-03-23 17:50:38 -07:00
Damian Jarek
222dcf7b18 Jamfile cleanup:
- Don't set the global link settings (`<link>`) to avoid dependency
ordering issues in the future.
- Allow the user to decide on the link settings for dependencies
(filesystem/coroutine).
- Make dependencies in examples explicit.
- Remove dependency of examples on Boost.Filesystem (was not used there).
- Deduplicate build settings.
- Speed up test compilation by avoiding rebuilding of main test file.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-03-21 17:23:49 +01:00
Damian Jarek
05f3f8a5ce Remove the need for OpenSSL in examples that don't use it
close #1524

It is now possible to compile examples without OpenSSL. Examples that
do require OpenSSL will be omitted.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-03-19 06:59:55 -07:00
Damian Jarek
8869ec5681 Use secure TLS/SSL versions:
TLS1.2 can be used instead, it is available in all currently
supported versions of OpenSSL.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-03-14 09:56:50 -07:00
Vinnie Falco
b51c4bb49a Tidy up examples 2019-03-06 05:40:49 -08:00