1 // 2 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 // 4 // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 // 7 // Official repository: https://github.com/boostorg/beast 8 // 9 10 #ifndef BOOST_BEAST_WEBSOCKET_OPTION_HPP 11 #define BOOST_BEAST_WEBSOCKET_OPTION_HPP 12 13 #include <boost/beast/core/detail/config.hpp> 14 15 namespace boost { 16 namespace beast { 17 namespace websocket { 18 19 /** permessage-deflate extension options. 20 21 These settings control the permessage-deflate extension, 22 which allows messages to be compressed. 23 24 @note Objects of this type are used with 25 @ref beast::websocket::stream::set_option. 26 */ 27 struct permessage_deflate 28 { 29 /// `true` to offer the extension in the server role 30 bool server_enable = false; 31 32 /// `true` to offer the extension in the client role 33 bool client_enable = false; 34 35 /** Maximum server window bits to offer 36 37 @note Due to a bug in ZLib, this value must be greater than 8. 38 */ 39 int server_max_window_bits = 15; 40 41 /** Maximum client window bits to offer 42 43 @note Due to a bug in ZLib, this value must be greater than 8. 44 */ 45 int client_max_window_bits = 15; 46 47 /// `true` if server_no_context_takeover desired 48 bool server_no_context_takeover = false; 49 50 /// `true` if client_no_context_takeover desired 51 bool client_no_context_takeover = false; 52 53 /// Deflate compression level 0..9 54 int compLevel = 8; 55 56 /// Deflate memory level, 1..9 57 int memLevel = 4; 58 }; 59 60 } // websocket 61 } // beast 62 } // boost 63 64 #endif 65