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
12
votes
2 answers

How to convert boost beast multi_buffer to string?

I copy websocket example from boost::beast website and run it Websocket session work fine but I don't know how to convert received multi_buffer to string. below code is websocket session handler. void do_session(tcp::socket &socket) { try { …
MohsenTi
  • 361
  • 1
  • 2
  • 17
10
votes
2 answers

C++ Send data in body with Boost.asio and Beast library

I've to use a C++ library for sending data to a REST-Webservice of our company. I start with Boost and Beast and with the example given here under Code::Blocks in a Ubuntu 16.04 enviroment. The documentation doesn't helped me in following…
Banzai
  • 189
  • 1
  • 2
  • 10
7
votes
1 answer

Boost Beast HTTP

I am working on a http parser, and it looks like boost.beast is a nice one. However, I still have some questions: *** Assume HTTP Request POST data already received via boost.asio socket. Stored inside a std::string buffer. Is there any good sample…
Jimmy
  • 153
  • 1
  • 6
6
votes
1 answer

How does boost::beast::bind_front_handler works?

I am trying boost::beast examples, I came across to this piece of code. void on_write(beast::error_code ec, std::size_t byte_transferred) { if (ec) return fail(ec, "write"); http::async_read(m_tcp_stream, m_buffer, m_response,…
foragerDev
  • 1,307
  • 1
  • 9
  • 22
6
votes
1 answer

Can't do https-request with boost beast

Im using mingw64. How can I make https-request using boost beast lib? I got code below and it works, but I recieve answer: "400 The plain HTTP request was sent to HTTPS port" What should I complete here to make https request? OpenSSL is…
Eugene
  • 129
  • 2
  • 9
6
votes
3 answers

Boost Beast Async Server Failing with Assertion failed: (id_ != T::id) on multiple aync calls

Assertion failed: (id_ != T::id), function try_lock, file /usr/local/include/boost/beast/websocket/detail/stream_base.hpp, line 91. // Echoes back all received WebSocket messages class session : public std::enable_shared_from_this { …
VikramChopde
  • 203
  • 1
  • 4
  • 11
6
votes
1 answer

boost beast message with body_limit

My starting point is to create a simple downloader code from the boost beast http_client_async example at boost http_client_async. In this scenario i want to write the received body into a file. So I exchanged the string body into a file_body, to…
user5685755
6
votes
1 answer

Problems making a sync http request through proxy using Boost Beast

I've modified the http_sync example to connect through a proxy, I've tested with wireshark and the problem is that after I send the http connect request, the proxy returns with the code 200 OK, and my program cant read that, it gets stuck waiting on…
6
votes
3 answers

Using Boost-Beast (Asio) http client with SSL (HTTPS)

I am new to SSL and the Boost-Beast library, and also C++, but that's a different story. I have a question regarding using HTTPS (SSL) with Beast. I am going to use the library to connect to a REST service and post JSON to a server where I do not…
user3259898
  • 85
  • 1
  • 1
  • 8
6
votes
1 answer

How to redirect from HTTP to HTTPS with Beast C++ library?

I am studying the Boost.Beast library. I try to make a request whose response is: HTTP/1.1 301 Moved Permanently Cache-Control: public Content-Type: text/html; charset=UTF-8 Location: https://www.example.com/target/xxx/ Then, I try to make a…
Juan Solo
  • 359
  • 1
  • 5
  • 17
5
votes
1 answer

How to listen to websocket feed using boost beast websocket client?

I'm new to beast and trying to create a websocket client which will subscribe to a websocket event in the remote server and start to listen for incoming messages forever unless I or the server explicitly close the connection. For now, I am using the…
Akil Demir
  • 150
  • 1
  • 11
5
votes
1 answer

How do you use boost/beast to parse and extract the payload from an HTTP POST request?

I am trying to understand how to process the contents of an HTTP POST request using the Boost Beast library. I have slightly modified the Boost Beast advanced server example to get a handle on things. I've added the following lines to the…
Rob Armstrong
  • 53
  • 1
  • 5
5
votes
1 answer

Boost::beast: Multiple async_write calls are firing an assertion error

I'm writing tests for my full-duplex server, and when I do multiple (sequential) async_write calls (although covered with a strand), I get the following assertion error from boost::beast in the file boost/beast/websocket/detail/stream_base.hpp: //…
The Quantum Physicist
  • 24,987
  • 19
  • 103
  • 189
4
votes
1 answer

Verify certificate in android by boost failed

I know that default path of certificates in android(maybe many devices) is /system/etc/security/cacerts , When I check the folder's contents I found that has *.0 files (too many files). 1- boost can detect this folder by default?…
H.M
  • 425
  • 2
  • 16
4
votes
2 answers

Can beast be used with C++20's co_await keyword?

C++20 introduced language support for coroutines. My understanding is that that this consists of syntactic sugar, such as co_await and co_return, to which semantic meaning is attached via special "hooks". The language support allows for idiomatic…
seertaak
  • 1,087
  • 1
  • 9
  • 17
1
2 3
18 19