hybi13.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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_DETAIL_HYBI13_HPP
  10. #define BOOST_BEAST_WEBSOCKET_DETAIL_HYBI13_HPP
  11. #include <boost/beast/core/static_string.hpp>
  12. #include <boost/beast/core/string.hpp>
  13. #include <boost/beast/core/detail/base64.hpp>
  14. #include <cstdint>
  15. namespace boost {
  16. namespace beast {
  17. namespace websocket {
  18. namespace detail {
  19. using sec_ws_key_type = static_string<
  20. beast::detail::base64::encoded_size(16)>;
  21. using sec_ws_accept_type = static_string<
  22. beast::detail::base64::encoded_size(20)>;
  23. BOOST_BEAST_DECL
  24. void
  25. make_sec_ws_key(sec_ws_key_type& key);
  26. BOOST_BEAST_DECL
  27. void
  28. make_sec_ws_accept(
  29. sec_ws_accept_type& accept,
  30. string_view key);
  31. } // detail
  32. } // websocket
  33. } // beast
  34. } // boost
  35. #if BOOST_BEAST_HEADER_ONLY
  36. #include <boost/beast/websocket/detail/hybi13.ipp>
  37. #endif
  38. #endif