258 Commits

Author SHA1 Message Date
Utsav Munendra
34c4647caf Correct common name of example server certificate 2022-06-21 20:39:25 -03: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
oerol
90e37ae40b return statement to exit reading loop
Merges PR#2414

I used this example to start building my WebSocket application, however, I noticed that upon removing the echoing in the on_read method, the server repeatedly throws errors without exiting the method.

You can recreate this problem by replacing the async_write with do_write and cause any error (i.e. client reloads the page).

Adding a return statement here would make debugging for future changes much easier and it wouldn't harm the existing echoing in any way.
2022-04-26 23:41:25 +02:00
ShuangLiu1992
b16005a456 Fix TLS SNI handling in websocket_client_async_ssl example:
Original commit message
fixed an error in websocket_client_async_ssl

close #2315

in this example host_ string should be updated after SSL_set_tlsext_host_name just like the synced version, otherwise this would cause a handshake error
2021-11-03 19:14:50 +01:00
Hreniuc Cristian-Alexandru
2f4506dc37 Fix accept error handling in http_server_async example
close #2319
2021-11-03 18:39:42 +01:00
mxp
01cd68c9a4 Add example of reading large response body
closes #2240
2021-05-26 12:12:45 +02:00
Richard Hodges
b1da28625e Update example root certificates
fixes #2236
2021-05-22 16:46:23 +02: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
Georg Gast
b07edea9d7 Fix logic error in advance_server_flex
fixes #2063
	closes #2064
2020-08-28 13:26:22 +02:00
Richard Hodges
a35cd32005 Update WebSocket examples to set TLS SNI 2020-08-28 13:26:22 +02:00
Richard Hodges
2efb729c53 Fix compile errors under Clang 3.4
fixes #2030
closes #2031
2020-07-24 13:59:49 +02:00
Richard Hodges
4f913cab63 Fix portability bug in websocket server sync example
fixes #2032
closes #2034
2020-07-24 13:59:46 +02: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
c397227eb5 Fix Host header in websocket examples
closes #1633
2020-04-08 15:56:39 +02:00
Richard Hodges
a21c1b7298 Fix examples to dispatch to strand
fix #1852
2020-03-17 16:04:21 +01:00
Richard Hodges
7ce6980042 fix strand use in example
fixes #1822
close #1823
2020-01-28 10:26:42 +01:00
Richard Hodges
b98c66a198 update DigiCert Global Root CA 2020-01-28 10:26:42 +01:00
Richard Hodges
35eaa441b9 Fix echo-op test
close #1789
2019-12-23 08:55:47 -08:00
Vinnie Falco
5521b91d8c Tidy up cmake files and examples 2019-10-06 08:04:22 -07:00
Damian Jarek
3eebf420f0 Add async-ssl-system-executor http client example
This example websocket 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
0f5d1edcd8 Fix data race in websocket examples
When using `websocket::stream`, the user has to take care to initiate
async operations within the associated strand.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-06 07:52:13 -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
Vinnie Falco
ec81771fdd root_certificates.hpp is not for production
fix #1702
2019-09-13 09:03:35 -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
Konstantin Podsvirov
56b5f8043f Clean up typo in chat websocket javascript client
It so happened that the code works, because both variables exist,
but the code was not clean.

close #1620
2019-06-01 18:15:25 +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
Damian Jarek
2eedbfedfc Add b2 features for compile-time options used in testing:
- `boost.beast.allow-deprecated=on` disables deprecated features.
- `boost.beast.separate-compilation=on` enables separate compilation.
- Add CI matrix items to check header-only, no-deprecated build.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-27 20:18:20 +02:00
Filip Matzner
1501962b92 Use steady_timer type
close #1606
2019-05-20 15:34:21 +02:00
Vinnie Falco
363d5c36d3 Don't pessimize-move 2019-05-20 15:34:21 +02:00
Konstantin Podsvirov
e5bad9cbc2 Make chat websocket javascript client more user friendly
Close #1611
2019-05-19 22:32:44 +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
tal
894917cb23 root_certificates.hpp: brought in the server certificate
close #1537

This allows for the self-sign ssl to work
2019-03-21 19:59:15 -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
45353a7f04 handler_ptr is deprecated (API Change):
* `handler_ptr` is deprecated and should not be used.

Actions Required:

* Replace use of `handler_ptr` with `stable_async_base`
  and `allocate_stable`.
2019-03-06 10:38:08 -08:00
Vinnie Falco
b51c4bb49a Tidy up examples 2019-03-06 05:40:49 -08:00
Vinnie Falco
e073a9e7fc Tidy up docs 2019-03-05 20:15:07 -08:00