forked from boostorg/beast
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.
This commit is contained in:
1 parent
085fb66b26
commit
3f50efa138
41 files changed
+1097
-1391
No files matched your search
@@ -96,7 +96,8 @@ struct stream<NextLayer, deflateSupported>::impl_type
|
||||
bool timed_out = false;
|
||||
int idle_counter = 0;
|
||||
|
||||
timeout timeout_opt;
|
||||
detail::decorator decorator_opt; // Decorator for HTTP messages
|
||||
timeout timeout_opt; // Timeout/idle settings
|
||||
|
||||
|
||||
template<class... Args>
|
||||
@@ -532,6 +533,7 @@ build_request(
|
||||
req.set(http::field::sec_websocket_key, key);
|
||||
req.set(http::field::sec_websocket_version, "13");
|
||||
this->build_request_pmd(req);
|
||||
decorator_opt(req);
|
||||
decorator(req);
|
||||
if(! req.count(http::field::user_agent))
|
||||
req.set(http::field::user_agent,
|
||||
|
||||
Reference in new issue
Block a user