Questions tagged [boost-beast]

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.

275 questions
3
votes
0 answers

C++ Boost Beast empty response body

I'm playing around with the Beast part of Boost and I'm trying to create a simple http client that can be used to /GET the content form a web resource (simple HTML or REST services). I've used the example that can be found in github repo of beast…
Fabian
  • 492
  • 6
  • 20
3
votes
2 answers

Why does Boost Variant use the template constructor instead of the move constructor for boost::beast::websocket::stream?

I am trying to wrap boost::beast::websocket::stream (for 2 specific T) in a boost::variant to allow treating TLS ([T = boost::asio::ssl::stream]) and non-TLS ([T = boost::asio::ip::tcp::socket]) websockets the same.…
Chris Hunt
  • 3,840
  • 3
  • 30
  • 46
3
votes
1 answer

How to access Beast on Boost 1.66 and 1.67 from CMake

I'm trying to make a CMake project with Beast, and it's properly installed from source in /usr/local/include/boost, but I can't get CMake to find it. I though it might have been a 3.10.2, so I tired 3.11.4 and 3.12.0-rc1, but neither worked. Does…
Aido
  • 1,524
  • 3
  • 18
  • 41
3
votes
1 answer

Does websocket guarantee the completeness of a single message? Should I implement my own header for websocket messages?

I'm writing a backend for a web-application in C++ (with boost-beast), and the front-end will probably use socket.io. So this question applies to both implementation and whether there's something in the websocket standard that answers my…
The Quantum Physicist
  • 24,987
  • 19
  • 103
  • 189
3
votes
1 answer

How to detect disconnection in websockt by using boost::beast?

I know I can use the error code in async_write, async_read to check the disconnection. However, in my situation, after I receiving something, I cannot write back immediately (or write back may never happens). During the time between reading and…
Robin Lew
  • 315
  • 4
  • 12
3
votes
2 answers

Boost::Beast Non Blocking Read for Websockets?

We have an app that is entirely synchronous, and will always be because it is basically a command line interpreter to send low level commands to our hardware, and you cant have two commands going to the hardware at the same time. I will only ever…
user1024792
  • 553
  • 1
  • 10
  • 23
3
votes
2 answers

Boost Beast 1 second delay in server response

I am trying to create an HTTP server using boost::beast but I noticed a delay of one second in response time. I used the advanced server example and synchronous client example to benchmark this behavior. Also tried to disable Nagle's algorithm but…
Laur P.
  • 93
  • 1
  • 7
3
votes
0 answers

Why is noexcept not used in async libraries (like Asio and Beast)

Asynchronous functions often do not use exceptions. Even on synchronous calls, Asio and Boost-Beast have overloads that take an output argument of type system_error& instead of throwing. Asynchronous operations can't throw exceptions because the…
Benjamin Buch
  • 4,752
  • 7
  • 28
  • 51
3
votes
1 answer

Asynchronous processing of streaming HTTP with boost::beast

I'm implementing a client which accesses a REST endpoint and then begins processing an SSE stream and monitoring events as they occur. To this end, I'm using Boost::Beast version 124 with Boost 1.63 and attempting to use async_read_some to…
Tim Clemons
  • 6,231
  • 4
  • 25
  • 23
3
votes
1 answer

How can i make Boost Beast Reply From A String Instead Of A File

I am trying to work with this example code boost beast advanced server example It compiles and works nice. Now i want to make it read from a given string to reply a Get or Post request instead of reading from a file. For example: Client sends a Get…
gokaysatir
  • 125
  • 2
  • 11
3
votes
2 answers

How to do async read/write Beast websockets alongside read/write of files?

I have my C++ program that forks into two processes, 1 (the original) and 2 (the forked process). In the forked process (2), it execs program A that does a lot of computation. The original process (1) communicates with that program A through…
user782220
  • 10,677
  • 21
  • 72
  • 135
2
votes
1 answer

Boost::beast how to close a (sync) reading websocket?

tl;dr: Is there a way to close a WebSocket that's currently doing (sync) read() operation, if server sends nothing for some time? I wanted to make a simple WebSocket client with Boost::beast. When I realized that read() is a blocking operation, and…
Latawiec
  • 341
  • 2
  • 10
2
votes
1 answer

Kraken API: 400 Bad Request when making AddOrder request using Boost.Beast

I am trying to make a request to the Kraken API's AddOrder endpoint using Boost.Beast in C++. This is the endpoint I am trying to access : https://docs.kraken.com/rest/#tag/User-Trading/operation/addOrder I am encoding the request body and passing…
2
votes
1 answer

Compilation Error due to Boost::Asio::Spawn function

RE: https://www.boost.org/doc/libs/1_80_0/libs/beast/example/websocket/client/coro-ssl/websocket_client_coro_ssl.cpp I tried following the above example and ran into a compilation error; namely, code C2039: 'type': is not a member of…
2
votes
1 answer

boost beast sync app - Is explicit concurrency handling needed?

Consider the official boost beast websocket server sync example Specifically, this part: for(;;) { // This buffer will hold the incoming message beast::flat_buffer buffer; // Read a message ws.read(buffer); // Echo the message…
ArthurChamz
  • 2,039
  • 14
  • 25