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
4
votes
1 answer

Boost-beast websocket handshake problems

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:…
Abhinav Boyed
  • 43
  • 1
  • 4
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
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

Should I clean up beast::flat_buffer when I see errors on on_read?

http_client_async_ssl class session : public std::enable_shared_from_this { ... beast::flat_buffer buffer_; // (Must persist between reads) http::response res_; ... } void on_write(beast::error_code ec,…
q0987
  • 34,938
  • 69
  • 242
  • 387
2
votes
0 answers

How to get request path in beast::websocket

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 a request from a client like…
2
votes
0 answers

Using boost::beast::websocket to send http post request

I've got the following class member boost::beast::websocket::stream ws_; which gets instantiated on class c'tor using boost::asio::io_service as parameter. I assume that all the websocket protocol is implemented on top of…
Zohar81
  • 4,554
  • 5
  • 29
  • 82
2
votes
1 answer

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 function or else) Standard examples aren't applied…
2
votes
1 answer

How to pass read handler to async_read for Beast websocket?

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 #include #include #include…
user782220
  • 10,677
  • 21
  • 72
  • 135
2
votes
2 answers

How to do async read/write with Beast websockets

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 not behave as expected. I expected the following…
Eskilade
  • 84
  • 2
  • 11
1
vote
1 answer

reduce response time while using async cpp boost socket

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 back to browser" action waits to the read handler…
redemption
  • 13
  • 4
1
vote
1 answer

How to find if the 'target' for websocket::stream::async_handshake() is not found?

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::size_t /*bytes_transferred*/) { if (ec) …
1
vote
0 answers

Implement publish/subscribe with Boost Beast

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 implement a pub/sub channel with…
benjist
  • 2,740
  • 3
  • 31
  • 58
1
vote
1 answer

How to resolve could not decode a text frame as UTF 8 though boost websocket

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 decode a text frame as UTF 8. the picture is…
vainman
  • 377
  • 1
  • 5
  • 18
1
vote
2 answers

How to set subprotocol with boost weboscket

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 subprotocol in websocket, which could be used in…
vainman
  • 377
  • 1
  • 5
  • 18
1
2 3