Skip to content

Commit

Permalink
fix: base64 sslclient key (#898)
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis authored Sep 28, 2023
1 parent 0dbb22e commit 87ec1a1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dpp/wsclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <dpp/wsclient.h>
#include <dpp/utility.h>
#include <dpp/httpsclient.h>
#include <dpp/discordevents.h>

namespace dpp {

Expand All @@ -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<const unsigned char*>(key.c_str()), key.length());
}

void websocket_client::connect()
Expand Down

0 comments on commit 87ec1a1

Please sign in to comment.