Questions tagged [beast-websockets]

Beast is a C++11 header-only library, part of Boost C++ library, serving as a foundation for writing inter operable networking libraries by providing low-level HTTP/1, WebSocket, and networking protocol vocabulary types and algorithms using the consistent asynchronous model of Boost.Asio. Beast Websockets deals with usage of Beast as a HTTP Websocket client/server library.

Beast HTTP/Websocket library documentation

See tag beast for Ruby on Rails forum.

See tag beast-attack for the “Browser Exploit Against SSL/TLS” is a vulnerability of the TLS 1.0 protocol discovered in 2011.

33 questions
1
vote
1 answer

Boost beast manupulate http response headers durring accept

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 I can't manipulate the response. It would be nice…
E.T.
  • 48
  • 5
1
vote
1 answer

Store a STL map into a Boost ConstBufferSequence

I'm trying to store a std::map 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 find a way to store a STL map. I've tried this: auto…
Shmwel
  • 1,697
  • 5
  • 26
  • 43
1
vote
2 answers

Call a boost function without callback

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 on_handshake(beast::error_code ec) into three…
RC0993
  • 898
  • 1
  • 13
  • 44
1
vote
1 answer

How to read the header of a bad request in beast::websocket?

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& res) // { if (res.result_int() == 400)…
Johnny
  • 93
  • 6
1
vote
1 answer

boost-beast websocket server that also accept http connections

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…
Daniele Pallastrelli
  • 2,430
  • 1
  • 21
  • 37
0
votes
0 answers

Is it possible to connect a c++ boost beast/asio websocket to a socket.io server in nodejs?

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 listen for any messages on localhost, port 3000.…
Captain Dando
  • 497
  • 2
  • 11
  • 30
0
votes
0 answers

Boost::beast async websocket doing read and write operations

I want a WebSocket client that's capable of reading and writing asynchronosuly. Reading is working A-OK thanks to other StackOverflow user. The idea behind reading is there's a thread that's always reading, permamently blocked. My writing-part idea…
Latawiec
  • 341
  • 2
  • 10
0
votes
0 answers

C++ boost beast websocket crash after running a while

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. Here is my…
Kevin Yin
  • 21
  • 1
  • 5
0
votes
1 answer

How to handle ping request on client (boost::beast::websocket)

Imagine that you have some websocket client, that downloading some data in loop like this: #include #include #include "nlohmann/json.hpp" namespace beast = boost::beast; namespace websocket =…
0
votes
1 answer

Reacting to each tick events from the websocket

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, std::size_t…
dopller
  • 291
  • 3
  • 13
0
votes
1 answer

How to use boost::beast to connect to Coinbase's websocket API

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 connect to the coinbase websocket api over here :-…
owagh
  • 3,428
  • 2
  • 31
  • 53
0
votes
1 answer

Measuring client back-up when using Boost.Beast WebSocket

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 will delay by 1 minute or more). What is the best…
jhourback
  • 4,381
  • 4
  • 26
  • 31
0
votes
2 answers

Get IP of Websocket on known port

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 client web browser (that is running on a separate…
MYZ
  • 331
  • 2
  • 10
0
votes
1 answer

boost websocket and io_context reusability for reestablishability of a connection

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, WEBSOCKET_HANDSHAKE, REGISTRATION, READY, …
abhiarora
  • 9,743
  • 5
  • 32
  • 57
0
votes
0 answers

How to use boost websocket to implement sub-protocol

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 provides this function, but I haven't found it in boost…
vainman
  • 377
  • 1
  • 5
  • 18