Beast is a C++ header-only library serving as a foundation for writing interoperable networking libraries by providing low-level HTTP/1, WebSocket, and networking protocol vocabulary types and algorithms using the consistent asynchronous model of Boost.Asio.
Questions tagged [boost-beast]
275 questions
2
votes
0 answers
boost::Beast error The WebSocket frame payload was not valid utf8
An error is passed to the callback function during the async_read operation. When displaying this error, the following line is printed
boost::Beast error The WebSocket frame payload was not valid utf8
How to solve this problem? I am transferring…

Anton
- 275
- 1
- 9
2
votes
0 answers
How to open file upload? (boost::beast)
As you can take from my Title, I have no ideas on how to open a file that's uploaded via my Rest Interface. I want to work with the file in the Body of the Request.
std::string fn = request["filename"].to_string();
std::cout << "fn: " << fn <<…

Limatuz
- 666
- 2
- 6
- 12
2
votes
2 answers
Clion show errors but the codes can be built successfully with Cmake
I'm try to learn about Boost::Beast with IDE CLion.
Here is my environment:
MacBook Pro (15-inch 2018) with Core i9
Compiler:
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.5.0
Thread model: posix
InstalledDir:…

RIN.OKAB3
- 51
- 2
2
votes
1 answer
Boost.beast http::read() returns `bad version`
Based on the two official examples /example/http/client/sync and /example/http/client/sync-ssl1 I am trying to build an HTTP client class that is able to handle both HTTP and HTTPS. As I am fairly new to boost.beast I reached out to figure out what…

Joel Bodenmann
- 2,152
- 2
- 17
- 44
2
votes
1 answer
OpenSSL no shared cipher
How can I use a certificate read from the Windows Certificate store in OpenSSL?
I've setup a Windows project based on Boost Beasts's http_server_async_ssl.cpp - basically added an https server into my project. When I use the hardcoded certificate…

Matt
- 1,928
- 24
- 44
2
votes
0 answers
boost::beast - auto reconnect (Websocket, c++)
how do you reconnect your websocket if the connection fails/breaks?
I'm currently using the example async_client:
https://www.boost.org/doc/libs/develop/libs/beast/example/http/client/async/http_client_async.cpp
The idea is to have a thread that…

D idsea J
- 103
- 1
- 8
2
votes
1 answer
How to reuse http::beast::flat_buffer and http::response?
I'm using boost::beast in my project. Following code is a modified version of example code. I tried to reuse flat_buffer and http::response in the following code, but the result is wrong. In the second query, the response body is concatenate of two…

PeopleMoutainPeopleSea
- 1,492
- 1
- 15
- 24
2
votes
1 answer
c++ boost http program, what's "need buffer" error?
Sometimes, boost http client async read response get an error code 5, message is "need buffer", I can't find any infomation about this error code, what's this error code mean?
void
do_read()
{
// Make the request empty before reading,
…

Meow
- 41
- 4
2
votes
2 answers
How do I avoid body_limit error in boost's beast and correctly handle large messages
I have cases when there is a chunked response which is too big for beast, and I want to stop before I get to beast's body_limit, and continue handling the message from that point using plain boost::asio. Mind that this (obviously) means I already…

david-hoze
- 1,045
- 15
- 31
2
votes
1 answer
Boost.Beast rate limiting
I am reading Boost.Beast documentation and I am trying to use rate limiting in my code:
io_context context;
tcp::resolver resolver(context);
basic_stream stream(context);
…

Jonny Dens
- 49
- 1
2
votes
2 answers
Boost Beast, how to supply login credentials
I am trying to send an http request to a device on our network that requires credentials.
For example in a webbrowser the request that works would…

mattking
- 133
- 6
2
votes
2 answers
Using Tcp timeout in beast 1.70.0
I have just now updated the boost library from 1.68.0 to 1.70.0 to get the timeouts operations in (beast) websocket ssl client async example.
In the above link you will see:
void
on_resolve(
beast::error_code ec,
…

RC0993
- 898
- 1
- 13
- 44
2
votes
1 answer
What are the requirements to read and write from an http stream (in boost::beast)?
I would like to use boost::beast to read and write to etcd. For starts, I'd like to be able to do these examples with boost beast. They're easily doable with curl. Etcd can be seen as a key/value store. The functions to set/get (put/range in the…

The Quantum Physicist
- 24,987
- 19
- 103
- 189
2
votes
1 answer
Why does this C++ ASIO, BEAST server go into a bad state when a HTTPS/SSL request is performed
I want to write a server that answers HTTP requests. I do not care about HTTPS. If somebody performs a HTTPS request I want to reject the request and continue with other HTTP requests. My code looks as follows:
#include
#include…

B.S.
- 1,435
- 2
- 12
- 18
2
votes
0 answers
C++ Url Routing (and possible parsing)
I start an api server with Boost Beast.
I use the async http server.
My goal is to do the same things as Express.js
For now I route like this :
if(req.method() == http::verb::post)
{
if(req.target() == "/mypath")
{
…

Vana
- 753
- 3
- 11
- 20