title: How to convert boost beast multi_buffer to string?
body: <p>I copy websocket example from boost::beast website and run it Websocket session work fine but I don't know how to convert received multi_buffer to string.</p>
  
  <p>below code is websocket session handler.</p>
  
  <pre><code>void
  do_session(tcp::socket &amp;socket) {
      try {
          // Construct the stream by moving in the socket
          websocket::stream &lt;tcp::socket&gt; ws{std::move(socket)};
  
          // Accept the websocket handshake
          ws.accept();
  
          while (true) {
              // This buffer will hold the incoming message
              boost::beast::multi_buffer buffer;
  
              // Read a message
              boost::beast::error_code ec;
              ws.read(buffer, ec);
  
              if (ec == websocket::error::closed) {
                  break;
              }
  
              // Echo the message back
              ws.text(ws.got_text());
              ws.write(buffer);
          }
  
          cout &lt;&lt; "Close" &lt;&lt; endl;
      }
      catch (boost::system::system_error const &amp;se) {
          // This indicates that the session was closed
          if (se.code() != websocket::error::closed)
              std::cerr &lt;&lt; "Error: " &lt;&lt; se.code().message() &lt;&lt; std::endl;
      }
      catch (std::exception const &amp;e) {
          std::cerr &lt;&lt; "Error: " &lt;&lt; e.what() &lt;&lt; std::endl;
      }
  }
  </code></pre>
  
  <p>Is there way to convert buffer to string ?</p>