Boost logo

Boost :

Subject: Re: [boost] [review][beast] Review of Beast starts today : July 1 - July 10
From: Vinnie Falco (vinnie.falco_at_[hidden])
Date: 2017-07-06 19:47:03

On Thu, Jul 6, 2017 at 12:25 PM, Vadim Zeitlin via Boost
<boost_at_[hidden]> wrote:
> WebSocket part is very useful, I think it's the best current
> implementation of the WebSocket protocol for C++.

Thanks! Finally some love for the WebSockets!

> I don't have any use for the HTTP part of myself

Ah, but don't you see? A bit of background:

A WebSocket session is established when the client sends an HTTP
Upgade request, and the server sends back an appropriate HTTP Upgrade
response ("101 Switching Protocols")

beast::websocket::stream gives you full control over the WebSocket
HTTP handshake used at the start of the session. You can adjust header
fields in either the client or server roles. On the server you can
read the HTTP request yourself and dispatch it to your web server if
its not a websocket upgrade, else hand the beast::http::request object
to the beast::websocket::stream to initiate the websocket session.

tl;dr Users get the full power of Beast's HTTP message facilities to
get control over the handshake. If you want to do Basic
Authentication, request subprotocols, pass application specific data
or credentials, verify domains, interact with proxy fields, filter
messages, etc... this is all possible using the uniform HTTP

WebSocket handshake customizations are documented here:


Boost list run by bdawes at, gregod at, cpdaniel at, john at