diff --git a/client_ws.hpp b/client_ws.hpp index 6a2f2932..bc123a3d 100644 --- a/client_ws.hpp +++ b/client_ws.hpp @@ -586,8 +586,9 @@ namespace SimpleWeb { connection->set_timeout(); // Send pong - auto empty_send_stream = std::make_shared<SendStream>(); - connection->send(empty_send_stream, nullptr, connection->message->fin_rsv_opcode + 1); + auto pong_stream = std::make_shared<SendStream>(); + *pong_stream << connection->message->string(); + connection->send(pong_stream, nullptr, connection->message->fin_rsv_opcode + 1); if(this->on_ping) this->on_ping(connection); diff --git a/server_ws.hpp b/server_ws.hpp index 06e87001..0c5c1537 100644 --- a/server_ws.hpp +++ b/server_ws.hpp @@ -688,8 +688,9 @@ namespace SimpleWeb { connection->set_timeout(); // Send pong - auto empty_send_stream = std::make_shared<SendStream>(); - connection->send(empty_send_stream, nullptr, fin_rsv_opcode + 1); + auto pong_stream = std::make_shared<SendStream>(); + *pong_stream << message->string(); + connection->send(pong_stream, nullptr, fin_rsv_opcode + 1); if(endpoint.on_ping) endpoint.on_ping(connection);