Skip to main content
Filter by
Sorted by
Tagged with
-6 votes
1 answer
85 views

I want to use websockets in a c++ project. For this I am using boost library. I ma currently unable to import the library. I have added the path in environment variable if i try to run the code this ...
Reyan Ahtesham's user avatar
1 vote
0 answers
95 views

Currently I'm using codes of this link text and in on_read I call a function which sends some string data multiple times in a loop, using ws_write(). The problem is that I can not read from the same ...
Rasoul.A's user avatar
0 votes
0 answers
592 views

I've been struggling to get a basic application going where I use boost to attempt to connect to a local webserver hosted on nodejs using express and socket.io. the idea is to host a socket server and ...
Captain Dando's user avatar
0 votes
0 answers
315 views

I am using boost beast to connect to a server's websocket. I only rewrite the on_read function in order to make the websocket never disconnect, the other parts are just copied from beast example code. ...
Kevin Yin's user avatar
0 votes
1 answer
2k views

Imagine that you have some websocket client, that downloading some data in loop like this: #include <boost/asio.hpp> #include <boost/beast.hpp> #include "nlohmann/json.hpp" ...
Shamil Mukhetdinov's user avatar
1 vote
1 answer
175 views

#define BINANCE_HANDLER(f) beast::bind_front_handler(&binanceWS<A>::f, this->shared_from_this()) template <typename A> class binanceWS : public std::enable_shared_from_this<...
noobie's user avatar
  • 25
2 votes
1 answer
595 views

http_client_async_ssl class session : public std::enable_shared_from_this<session> { ... beast::flat_buffer buffer_; // (Must persist between reads) http::response<http::...
q0987's user avatar
  • 36.2k
0 votes
1 answer
251 views

I would like to design my trading system reacting to each tick events from the websocket stream i subscribed to. So basically i have two options : void WebsocketClient::on_write(beast::error_code ec, ...
dopller's user avatar
  • 361
2 votes
1 answer
275 views

I have the following beast::websocket example working: https://www.boost.org/doc/libs/1_76_0/libs/beast/example/websocket/server/async/ Starting from that code, and assuming that I want to distinguish ...
Carlos Lobo's user avatar
1 vote
1 answer
323 views

i've created an async beast server that gets a request from a browser, opens a second socket , writes the request , gets the response and sends it back to the browser. all async . as the "send ...
redemption's user avatar
1 vote
1 answer
527 views

For HTTP calls, you can do: http::async_read(m_stream, m_buffer, m_res, beast::bind_front_handler(&RestSession::on_read, shared_from_this())); // ... then void on_read(beast::error_code ec, std::...
subatomicdev's user avatar
3 votes
0 answers
500 views

I've got the following class member boost::beast::websocket::stream<boost::beast::tcp_stream> ws_; which gets instantiated on class c'tor using boost::asio::io_service as parameter. I assume ...
Zohar81's user avatar
  • 5,214
2 votes
1 answer
564 views

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 ...
user2426998's user avatar
0 votes
1 answer
754 views

I'm a bit new to websocket programming. I've been trying to use this example :- https://www.boost.org/doc/libs/develop/libs/beast/example/websocket/client/async-ssl/websocket_client_async_ssl.cpp to ...
owagh's user avatar
  • 3,536
0 votes
1 answer
384 views

I am reading from a Boost.Beast WebSocket. When my application gets backed up, the websocket sender appears happy to delay/buffer the data on their end (presumably at the application level, as they ...
jhourback's user avatar
  • 4,641
0 votes
2 answers
1k views

I have built a websocket in C++ (using boost::beast). It is going to serve a website (client) with a JSON string if requested. When designing my setup I made a disastrous mistake: I forgot that the ...
MYZ's user avatar
  • 369
0 votes
1 answer
1k views

I have writted a small websocket client using boost::beast::websocket and boost::asio::io_context in C++. I am having a state machine with following states: enum class State { GDR_PROVISING, ...
abhiarora's user avatar
  • 10.6k
1 vote
0 answers
396 views

I have a Websocket server based on Boost Beast and I want to implement a publish / subscribe pattern. My current code base is based on the advanced/flex example. Is there a recipe / pattern on how to ...
benjist's user avatar
  • 2,937
0 votes
0 answers
215 views

I want to implement a websocket sub-protocol. For example, I have a weboscket server as ws://localhost:1234, now I need one more sub-protocol as ws://localhost:1234/sub. I know lib-websockets ...
vainman's user avatar
  • 457
1 vote
1 answer
2k views

I write a websocket though boost, and I receive the message though the client in chrome. When I use ws, it works well, I can receive correct msg. but when I use wss, it works bad, and said could not ...
vainman's user avatar
  • 457
-1 votes
1 answer
2k views

I want to reliaze how to use boost::aio::async_connect with lambda. Boost version 1.68 It's really strange that I could use std::bind but not lambda. If I use std::bind, it work. But when I use ...
vainman's user avatar
  • 457
1 vote
2 answers
735 views

I want to use the subprotocol with boost websocket. For example, I have s websocket server address , ws://127.0.0.1:5005. Now I want to replace it with ws://127.0.0.1:5005/order. "order" is the ...
vainman's user avatar
  • 457
1 vote
1 answer
854 views

I've wrote an async websocket thru boost.beast. But when I try to run it, I cannot connect it. The server code like below. When I try to connect my websocket server, my chrome shows status connecting....
vainman's user avatar
  • 457
4 votes
1 answer
6k views

I am attempting to set up a websocket connection with a remote server and get the following error: The WebSocket handshake was declined by the remote peer I am following this example: https://www....
Abhinav Boyed's user avatar
1 vote
1 answer
615 views

I would like to manipulate the http response sent to the websocket client durring accept. I've read the examples and the manual, I can pare the request, check if it's a websocket upgrade request, but ...
E.T.'s user avatar
  • 48
1 vote
1 answer
255 views

I'm trying to store a std::map<enum, int> in a boost::beast::multi_buffer. So far I've been using boost::asio::buffer_copy and boost::asio::buffer to store vectors and PODs. However, I couldn't ...
Shmwel's user avatar
  • 1,695
1 vote
2 answers
161 views

I am using boost-beast library for a websocket connection. You can refer to this example for the understanding what is happening. I have used the same example, but changed a few things: split the ...
RC0993's user avatar
  • 978
1 vote
1 answer
1k views

I have a websocket server(listening the loopback interface) that should respond to a GET request. Here's how I do that ws_.async_accept_ex( [self = shared_from_this()](websocket::response_type&...
Johnny's user avatar
  • 93
0 votes
1 answer
1k views

I'm working on an application in which I want to use boost::beast/asio. I need to receive data via a websocket connection and issue requests to a REST API at the same time. In the boost::beast ...
b20000's user avatar
  • 1,005
1 vote
1 answer
2k views

I need to implement a simple asynchronous websocket server using boost beast that can accept both websocket and standard http connections. I've tried something like this: ... // ws is a boost::...
Daniele Pallastrelli's user avatar
4 votes
1 answer
4k views

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....
Aido's user avatar
  • 1,614
2 votes
1 answer
2k views

How do I pass in a callback to async_read? I tried the following but it won't compile. I based this off of modifying code from the docs #include <beast/core.hpp> #include <beast/http.hpp> ...
user782220's user avatar
  • 11.3k
3 votes
2 answers
2k views

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 (...
user782220's user avatar
  • 11.3k
2 votes
2 answers
7k views

How can I do async write and read using websockets from the Beast library? I have tried to adapted the synchronous write/read example provided in the Beast documentation here, but the code below does ...
Eskilade's user avatar
  • 104