diff --git a/CHANGELOG.md b/CHANGELOG.md index 40df3ecd..88fa8b53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Version 44 * Tidy up and make get_lowest_layer public * Use BOOST_STATIC_ASSERT * Fix async return values in docs +* Fix README websocket example -------------------------------------------------------------------------------- diff --git a/README.md b/README.md index 671236a6..90851669 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ and run yourself (they are in the `examples` directory). Example WebSocket program: ```C++ -#include +#include #include #include #include @@ -178,11 +178,11 @@ int main() ws.write(boost::asio::buffer(std::string("Hello, world!"))); // Receive WebSocket message, print and close using beast - beast::streambuf sb; + beast::multi_buffer b; beast::websocket::opcode op; - ws.read(op, sb); + ws.read(op, b); ws.close(beast::websocket::close_code::normal); - std::cout << beast::to_string(sb.data()) << "\n"; + std::cout << beast::buffers(b.data()) << "\n"; } ```