mirror of
https://github.com/boostorg/beast.git
synced 2026-05-05 04:04:30 +02:00
permessage-deflate is a compile-time feature (API Change):
fix #849 This adds an additional `bool` template parameter to `websocket::stream`: * When deflateSupported is `true`, the stream will be capable of negotiating the permessage-deflate websocket extension per the configured run-time settings. * When deflateSupported is `false`, the stream will never negotiate the permessage-deflate websocket extension. Furthermore, all of the code necessary for implementing the permessage-deflate extension will be excluded from function instantiations. The resulting emitted object code should be smaller.
This commit is contained in:
@@ -57,7 +57,7 @@ boost::asio::ip::tcp::socket sock{ioc};
|
||||
|
||||
{
|
||||
//[ws_snippet_6
|
||||
std::string const host = "mywebapp.com";
|
||||
std::string const host = "example.com";
|
||||
boost::asio::ip::tcp::resolver r{ioc};
|
||||
stream<boost::asio::ip::tcp::socket> ws{ioc};
|
||||
auto const results = r.resolve(host, "ws");
|
||||
@@ -310,6 +310,16 @@ struct custom_wrapper
|
||||
|
||||
//]
|
||||
|
||||
//[ws_snippet_26
|
||||
|
||||
// A WebSocket stream
|
||||
template<
|
||||
class NextLayer,
|
||||
bool deflateSupported = true>
|
||||
class stream;
|
||||
|
||||
//]
|
||||
|
||||
} // doc_ws_snippets
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user