33 questions
2
votes
1
answer
74
views
Boost.Beast async_connect fails after upgrading Boost 1.78 to 1.89
I have a Websocket class that connects asynchronously using Boost.Asio and Boost.Beast. The following code was working fine with Boost 1.78, but after updating to the latest Boost version, I now get a ...
3
votes
1
answer
99
views
Is it correct to reset the connection in websocket::stream_base::decorator callback?
I have a websocket server where I call websocket::stream::async_accept to perform a handshake with the client.
I also set a decorator to modify the headers like this
conn->get_websocket_stream()....
1
vote
1
answer
69
views
WebSocket interface binding not working with Boost.Beast - socket still uses default interface
I'm trying to bind a WebSocket connection to a specific network interface using Boost.Beast, but the socket keeps using the default interface instead of the specified one.
I have a WebSocket client ...
1
vote
1
answer
69
views
Beast Socket from Boost Python Package Kills Jupyter Kernel
For some reason when exposing the below to python using Boost Python, the unique pointer constructor (the obj constructor) fails. This used to work for me before, not sure why it stopped.
#pragma once
...
0
votes
0
answers
99
views
Boost Beast WebSocket server Opening and Closing connection does not deallocate all memory on heap
I have been working to understand a series of unexplained memory allocations that don’t make sense in the boost beast websocket framework. I have taken the example of the async server implementation ...
3
votes
1
answer
100
views
Trying to Implement Idle Timeout by cancelling current async_read and continuing with next read/write operation
I am using a timer and an async_read, so whenever the timer runs out it cancels the async_read by doing ws_.next_layer().cancel() so that i can continue with my next operation. but when I catch the ...
0
votes
1
answer
143
views
Boost Beast Websocket verify client certificate more than once on connection
I have a Boost Beast asio based websocket server, which (in abbreviated form) starts like this
ssl_context_.set_options(
boost::asio::ssl::context::default_workarounds |
boost::asio::ssl::...
0
votes
1
answer
178
views
boost::beast::websocket server doesn't react to client close()
I have a boost::beast HTTP server that streams data to a connected client. I'm happy to ignore anything they send to me, so I constantly call async_write without calling async_receive. But I think ...
1
vote
1
answer
1k
views
Websocket boost/beast example with client/server
Maybe somebody can provide simple example(or references) on how to setup client and server using websocket from boost/beast library? I need an example on how to handle input message on server and ...
5
votes
0
answers
2k
views
boost::beast vs uwebsockets library performance c++
I'm porting a python application over to C++. As I'm not incredibly familiar with C++ I was wondering if there are any benchmark test result out there for websocket latency between the two libraries ...
1
vote
1
answer
123
views
Does a coroutine call boost::asio::write block the current thread?
When the coroutine calls boost::asio::write, the coroutine will block waiting for the buffer to become writable or the coroutine will be scheduled out because the tcp buffer is full?
1
vote
0
answers
157
views
c++ gemini websocket connection. error uninitialized
I am trying to create a basic vanilla websocket client using c++ and the boost/beast library. Following the examples, I can create an unsecured ws connection. But when I try to incorporate ssl into ...
1
vote
0
answers
943
views
boost::beast reconnect websocket after close
I'm messing around with the beast async websocket client and want it to re-connect in the same session instance if it becomes disconnected. The issue is that everything works until I attempt the ...
1
vote
1
answer
178
views
IO Context is not running in separate threads
I am trying to run a Kraken websocket client for two symbols, AUD/USD and AUD/JPY, in separate
IOContexts in separate threads, using C++ and the Boost.Beast library. I have 6 cores available
and want ...
2
votes
1
answer
2k
views
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 ...
1
vote
1
answer
396
views
How to send websocket message while waiting to receive?
My goal is to register to a websocket service to get real-time company quotations.
So I based my code on the following example, by mostly calling (again) async_read, once we receive a quotation to ...
2
votes
1
answer
213
views
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 ...
0
votes
0
answers
443
views
How to enable async boost::beast websocket applications to support multiple connections for load balance?
Reference:
https://www.boost.org/doc/libs/1_80_0/libs/beast/example/websocket/client/async-ssl/websocket_client_async_ssl.cpp
My websocket client application was built based on the above example. Now ...
2
votes
0
answers
603
views
Boost Beast Websocket: Application Data After Close Notify
I am using boost::beast as well as boost::asio to implement a websocket client with SSL support. My WebsocketClient class has the following members:
boost::asio::io_context& io_context;
...
4
votes
2
answers
1k
views
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 &...
1
vote
1
answer
460
views
Do I need to call async_shutdown on beast::ssl_stream<beast::tcp_stream> when experience issues?
https://www.boost.org/doc/libs/1_72_0/libs/beast/example/http/client/async-ssl/http_client_async_ssl.cpp
std::unique_ptr<tcp::resolver> resolver_{nullptr};
std::unique_ptr<beast::ssl_stream&...
1
vote
1
answer
98
views
Understand function parameters(pass by value instead of by const reference) in boost::beast client example websocket_client_async_ssl.cpp
Reference:
boost_1_78_0/doc/html/boost_asio/reference/ip__basic_resolver/async_resolve/overload1.html
template<
typename ResolveHandler = DEFAULT>
DEDUCED async_resolve(
const query &...
3
votes
1
answer
1k
views
Understand the usage of strand without locking
Reference:
websocket_client_async_ssl.cpp
strands
Question 1> Here is my understanding:
Given a few async operations bound with the same strand, the strand
will guarantee that all associated async ...
1
vote
1
answer
1k
views
How to suppress "ERROR message: short read (SSL routines, SSL routines), value: 335544539"
Reference:
websocket_client_sync_ssl.cpp
// Read a message into our buffer
ws.read(buffer);
// Close the WebSocket connection
ws.close(websocket::close_code::normal);
Based on my test, the ws....
1
vote
1
answer
2k
views
How to print the WebSocket HTTP Upgrade Request?
Reference: websocket_client_sync.cpp
Table 1.30. WebSocket HTTP Upgrade Request
GET / HTTP/1.1
Host: www.example.com
Upgrade: websocket
Connection: upgrade
Sec-WebSocket-Key: 2pGeTR0DsE4dfZs2pH+8MA==
...
0
votes
1
answer
1k
views
Fastest way to close a websocket and free up file discriptors
I am using boost beast for making websocket connections, a process of mine may have a large number of streams/connections and while terminating the process I am calling blocking close of each ...
3
votes
1
answer
598
views
boost async ws server checking client information
How do i check client information as user-agent from boost async web socket server ?
I have checked:
https://www.boost.org/doc/libs/develop/libs/beast/example/websocket/server/async/...
2
votes
0
answers
367
views
Boost beast read: The WebSocket control frame was fragmented
While I am trying the code from:
advanced_server example
I am getting following error here:
read: The WebSocket control frame was fragmented
The client is sending ping control message using Poco ...
0
votes
2
answers
5k
views
RST after Client hello
Boost beast TLS client (largely based on this) which is not connecting to Microsoft Azure azurewebsites hosted web app. Viewing the Wireshark output, it appears that the server is sending RST after ...
1
vote
2
answers
1k
views
Boost::beast::ssl_stream unable to deference the shared pointer, need to transform ssl_stream to websocket::stream
I am trying to write a https flex server, that can upgrade to websocket based on upgrade request. https class does the ssl handshake on std::shared_ptr<boost::beast::ssl_stream<boost::beast::...
5
votes
1
answer
6k
views
How can I get the data inside a beast::flat_buffer?
I'm connecting to a websocket using the boost/beast libraries and writing the data into a beast::flat_buffer. My issue is that I'm having trouble getting the data from buffer. I have a thread-safe ...
0
votes
1
answer
2k
views
Exception In boost-beast
I use Boost::Beast and i got somme exception message for exemple : resolve: No such host is known.
I want in my code to print i message more significant that can a simple user get a idea what this ...
2
votes
1
answer
564
views
Is there any way to subscribe and to listen feed in boost beast websocket?
I am using an example from boost beast documentation for async websocket client. The to send some command to subscribe and then to listen feed until it is terminated manually (preferably with other ...