diff --git a/src/dpp/wsclient.cpp b/src/dpp/wsclient.cpp index f7b90ece5f..aa9c657240 100644 --- a/src/dpp/wsclient.cpp +++ b/src/dpp/wsclient.cpp @@ -25,6 +25,7 @@ #include #include #include +#include namespace dpp { @@ -38,11 +39,12 @@ constexpr size_t MAXHEADERSIZE = sizeof(uint64_t) + 2; websocket_client::websocket_client(const std::string &hostname, const std::string &port, const std::string &urlpath, ws_opcode opcode) : ssl_client(hostname, port), - key(std::to_string(time(nullptr))), state(HTTP_HEADERS), path(urlpath), data_opcode(opcode) { + key = std::to_string(time(nullptr)); + key = base64_encode(reinterpret_cast(key.c_str()), key.length()); } void websocket_client::connect()