option.hpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. #ifndef BOOST_BEAST_WEBSOCKET_OPTION_HPP
  10. #define BOOST_BEAST_WEBSOCKET_OPTION_HPP
  11. #include <boost/beast/core/detail/config.hpp>
  12. namespace boost {
  13. namespace beast {
  14. namespace websocket {
  15. /** permessage-deflate extension options.
  16. These settings control the permessage-deflate extension,
  17. which allows messages to be compressed.
  18. @note Objects of this type are used with
  19. @ref beast::websocket::stream::set_option.
  20. */
  21. struct permessage_deflate
  22. {
  23. /// `true` to offer the extension in the server role
  24. bool server_enable = false;
  25. /// `true` to offer the extension in the client role
  26. bool client_enable = false;
  27. /** Maximum server window bits to offer
  28. @note Due to a bug in ZLib, this value must be greater than 8.
  29. */
  30. int server_max_window_bits = 15;
  31. /** Maximum client window bits to offer
  32. @note Due to a bug in ZLib, this value must be greater than 8.
  33. */
  34. int client_max_window_bits = 15;
  35. /// `true` if server_no_context_takeover desired
  36. bool server_no_context_takeover = false;
  37. /// `true` if client_no_context_takeover desired
  38. bool client_no_context_takeover = false;
  39. /// Deflate compression level 0..9
  40. int compLevel = 8;
  41. /// Deflate memory level, 1..9
  42. int memLevel = 4;
  43. };
  44. } // websocket
  45. } // beast
  46. } // boost
  47. #endif