Skip to content

Commit

Permalink
Attempt to fix websocket issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasper Peeters committed Dec 23, 2024
1 parent a6bf3d3 commit 60f8c91
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client_server/websocket_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,16 @@ void websocket_client::connect(const std::string& uri_string)
if (is_ssl_) {
wss_stream_ = std::make_unique<boost::beast::websocket::stream<
boost::beast::ssl_stream<boost::asio::ip::tcp::socket>>>(ioc_, ssl_ctx_);
wss_stream_->binary(false); // Set to text mode
wss_stream_->auto_fragment(false); // Don't fragment messages
wss_stream_->read_message_max(64 * 1024 * 1024); // 64MB max message size
}
else {
ws_stream_ = std::make_unique<boost::beast::websocket::stream<
boost::asio::ip::tcp::socket>>(ioc_);
ws_stream_->binary(false); // Set to text mode
ws_stream_->auto_fragment(false); // Don't fragment messages
ws_stream_->read_message_max(64 * 1024 * 1024); // 64MB max message size
}

// Start the connection process
Expand Down

0 comments on commit 60f8c91

Please sign in to comment.