Commit Graph

49 Commits

Author SHA1 Message Date
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
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
Vinnie Falco
fca4b3ae10 make_strand is in net:: 2019-03-02 07:33:57 -08:00
Vinnie Falco
bf2523b190 Tidy up an unused function 2019-03-01 11:02:52 -08:00
Vinnie Falco
8eb15148d7 Advanced servers use HTTP parser interfaces for reading 2019-02-28 10:04:52 -08:00
Vinnie Falco
16280f9991 Remove extraneous error check in advanced-server-flex
fix #1484
2019-02-28 07:54:20 -08:00
Vinnie Falco
8f9eed1faf stream_base::timeout::suggested is a nested function 2019-02-27 06:52:45 -08:00
Vinnie Falco
0647c902ac role_type is in boost/beast/core/role.hpp (API Change):
This enumeration is now part of the library core and
not specific to websocket.
2019-02-26 07:20:46 -08:00
Vinnie Falco
6331e03a3a OpenSSL is required for tests and examples 2019-02-23 11:15:59 -08:00
Vinnie Falco
094f5ec5cb Better treatment of SSL short reads:
fix #38

This improves the behavior when encountering a short read:

* Any stream error encountered during a read is converting into
  `http::error::partial_message` if some data was received but
  the message is incomplete.

* Examples squelch SSL short read errors from the logs.
2019-02-23 08:56:59 -08:00
Vinnie Falco
90b783cb62 detect_ssl, async_detect_ssl are public interfaces 2019-02-22 15:39:34 -08:00
Vinnie Falco
6ada618c12 Check BOOST_NO_CXX11_THREAD_LOCAL 2019-02-21 11:09:02 -08:00
Vinnie Falco
c3c3777661 Pass strand to async_accept 2019-02-20 15:30:03 -08:00
Vinnie Falco
6baa607295 Fixes to support Asio changes (API Change):
This adjusts Beast's interfaces and implementation to match
the changes in Boost.Asio.
2019-02-19 16:23:30 -08:00
Vinnie Falco
3f50efa138 WebSocket Decorator is a socket option (API Change):
This changes the interface used to apply a decorator to the HTTP
request or response messages used to perform the WebSocket handshake
as follows:

* Add the `stream_base::decorator` option object

* Add `stream::set_option` overload to set the decorator from
  the option

* The decorator applies to all client and server handshakes
  performed on the stream after the option is set.

* Overloads of the following functions which accept a Decorator
  are deprecated:
  - accept, accept_ex
  - handshake, handshake_ex
  - async_accept, async_accept_ex
  - async_handshake, async_handshake_ex

Actions Required:

* Code which passes decorator to any `websocket::stream` member
  function should call `stream::set_option` instead with a newly
  constructed `stream_base::decorator` object containing the
  decorator. Alternatively, the macro `BOOST_BEAST_ALLOW_DEPRECATED`
  may be defined to 1.
2019-02-19 16:23:30 -08:00
Vinnie Falco
fc7b47fc5d Use suggested timeouts in Websocket examples 2019-02-18 12:18:27 -08:00
Vinnie Falco
ca1b620527 Use std::bind for control_callback 2019-02-16 15:09:34 -08:00
Vinnie Falco
18447553ca Examples use bind_front_handler 2019-02-14 17:28:54 -08:00
Vinnie Falco
45d722874f Use tcp_stream, HTTP timeouts in advanced servers 2019-02-10 11:43:15 -08:00
Daniel Sewtz
cd28598e5b Fixes to rfc7230:
fix #1435, fix #1438

* Example and test can be built on msvc v141 15.9.6
  using /std:c++17 and BOOST_BEAST_USE_STD_STRING_VIEW.

* changed string_view.to_string() to std:string(string_view),
  awaiting availability of Library Fundamentals TS here.

* Reactivated relevant tests to param_list. #ifdef 0 test
  exhibited same assertion failed error in debug mode.
  Now fixed in DEBUG on msvc v141 15.9.6 with
  BOOST_BEAST_USE_STD_STRING_VIEW and /std:c++17.

* Looked up http paramters (transfer-encoding, etc.)
  and changed tests as well as fixing comment to
  match specs.
2019-02-07 17:37:18 -08:00
Vinnie Falco
b337abe076 examples use flat_buffer
fix #1401
2019-01-15 11:42:05 -08:00
Vinnie Falco
f995fd41a3 net is a namespace alias for boost::asio:
The namespace alias beast::net replaces boost::asio in all code
and documentation.
2018-12-02 17:51:43 -08:00
Vinnie Falco
5bff4ed8ab Tidy up warnings and deprecated usage:
fix #1290

* BOOST_ASIO_NO_DEPRECATED=1 is now set
* Fix various warnings from the Boost regression test matrix
* Fix a bug in advanced servers when checking for a timeout
2018-11-26 15:30:48 -08:00
Vinnie Falco
c18f3f0ef1 Rename to _experimental directory 2018-11-12 06:52:39 -08:00
Vinnie Falco
04bac8dce9 Remove extraneous strand from example
fix #1288
2018-11-03 19:30:16 -07:00
jarle
2b977f2770 Fix timer on websocket upgrade in examples
fix #1091, fix #1240, fix #1253
2018-10-07 10:38:36 -07:00
cos-public
c2ecba968c Check error in example set_option
fix #1186
2018-07-12 11:07:10 -07:00
Vinnie Falco
f48b978044 Use a shared string for example HTTP server doc roots
fix #1109
2018-05-03 14:18:33 -07:00
Vinnie Falco
292801fef7 Add ssl_stream to experimental:
The ssl_stream wrapper provides C++11 move semantics for ssl::stream,
as well as incorporating the flat_stream workaround for a performance
problem with ssl::stream writes and buffer sequences having length
greater than one.
2018-05-02 08:32:09 -07:00
Vinnie Falco
f1b1ee2345 Fix race in advanced server examples
fix #1073
2018-04-12 08:54:44 -07:00
Vinnie Falco
04ced3b954 Examples clear the HTTP message before reading
fix #1043
2018-02-27 08:12:54 -08:00
Vinnie Falco
10ce0283c2 Advanced servers support clean shutdown via SIGINT or SIGTERM
fix #1026
2018-02-21 12:44:11 -08:00
Vinnie Falco
a4714746dc Examples set reuse_address(true)
fix #1027
2018-02-21 12:35:07 -08:00
Benjamin Roland Buch
9f3c981d6a Fix memory leak in advanced server examples 2018-02-14 21:24:59 -08:00
Vinnie Falco
72cf7db931 Fix use-after-move in example request handlers
fix #992
2018-01-25 06:02:43 -08:00
Vinnie Falco
7ac24d77be Send idle pings in advanced servers:
fix #899

The timer logic for the advanced-server and advanced-server-flex
examples is refactored to use idle pings when the connection has
not seen activity for some period of time. This demonstrates the
use of the stream's control_callback interface.
2017-11-27 16:44:59 -08:00
Vinnie Falco
2555942010 Use message::need_eof in example servers 2017-10-25 18:48:19 -07:00
Vinnie Falco
3a28e999af Update for Net-TS Asio (API Change):
fix #769

The following classes are removed:

* handler_type
* async_result
* async_completion
* is_dynamic_buffer
* is_const_buffer_sequence
* is_mutable_buffer_sequence
* handler_alloc

Actions Required:

* Use BOOST_ASIO_HANDLER_TYPE instead of handler_type
* Use BOOST_ASIO_INITFN_RESULT_TYPE instead of async_result
* Use boost::asio::async_completion
* Use boost::asio::is_dynamic_buffer
* Use boost::asio::is_const_buffer_sequence
* Use boost::asio::is_mutable_buffer_sequence
* boost::asio::associated_allocator_t replaces handler_alloc
2017-10-23 17:11:27 -07:00
Vinnie Falco
bbc1f14347 Fix spurious strand_ in advanced_server_flex 2017-10-01 10:14:47 -07:00
Peter Jankuliak
fa4df7eb60 Remove unused strands in server examples 2017-09-25 21:33:04 -07:00
Vinnie Falco
38e28966ea message::version is a member function (API Change):
fix #778

* The version data member is replaced with accessor
  member functions.

Actions Required:

* Call member function message::version instead of accessing
  the version member at call sites.
2017-09-12 17:13:02 -07:00
Vinnie Falco
54fe7cacf7 message::body is a member function (API Change):
fix #778

* The body data member is replaced with accessor
  member functions.

Actions Required:

* Call member function message::body instead of accessing
  the data member at call sites.
2017-09-12 17:12:12 -07:00
Vinnie Falco
c0e5f14702 WebSocket writes return the bytes transferred (API Change):
* Stream write operations now return the number of bytes
transferred from the caller's input buffers.

Actions Required:

* Modify websocket write completion handlers to receive
  the extra std::size_t bytes_transferred parameter.
2017-09-03 20:05:19 -07:00
Vinnie Falco
59d4b85e15 Don't use async_write_msg in examples
fix #746
2017-08-18 07:55:30 -07:00
Vinnie Falco
830e651f99 Fix argument parsing in HTTP examples
fix #746
2017-08-18 07:55:20 -07:00
Vinnie Falco
d613feae01 Example HTTP server fixes 2017-08-08 19:25:35 -07:00
Vinnie Falco
dd71b0f94d Refactor all examples:
fix #575, fix #604, fix #608, fix #634, fix #712

All examples are rewritten:

* Using Best Practices
* Mostly self-contained
* New examples to complete the feature matrix
* The server-framework example is removed
2017-08-07 20:53:11 -07:00