Beast Logo


WebSocket FAQ

What about message compression?

Beast WebSocket supports the permessage-deflate extension described in draft-ietf-hybi-permessage-compression-00. The library comes with a header-only, C++11 port of ZLib's "deflate" codec used in the implementation of the permessage-deflate extension.

Where is the TLS/SSL interface?

The websocket::stream wraps the socket or stream that you provide (for example, a boost::asio::ip::tcp::socket or a boost::asio::ssl::stream). You establish your TLS connection using the interface on ssl::stream like shown in all of the Asio examples, then construct your websocket::stream around it. It works perfectly fine; Beast.WebSocket doesn't try to reinvent the wheel or put a fresh coat of interface paint on the ssl::stream.

The WebSocket implementation does provide support for shutting down the TLS connection through the use of the ADL compile-time virtual functions teardown and async_teardown. These will properly close the connection as per rfc6455 and overloads are available for TLS streams. Callers may provide their own overloads of these functions for user-defined next layer types.