Fix Database
Add WS Header
This commit is contained in:
1 parent
c214d473e2
commit
176c43d5a6
4 files changed
+42
-39
No files matched your search
@@ -8,8 +8,9 @@ namespace gaconnector
|
||||
{
|
||||
Websocket::Websocket(std::string host,
|
||||
std::string user,
|
||||
std::string token,
|
||||
std::function<void(const std::string)> toLog)
|
||||
: host(host), user(user), toLog(std::move(toLog))
|
||||
: host(host), user(user), token(token), toLog(std::move(toLog))
|
||||
{
|
||||
#ifdef IBM
|
||||
// Required on Windows
|
||||
@@ -17,6 +18,9 @@ namespace gaconnector
|
||||
#endif
|
||||
|
||||
this->webSocket = new ix::WebSocket();
|
||||
this->webSocket->setExtraHeaders({
|
||||
{ "Authentication", "Bearer " + this->token }
|
||||
});
|
||||
this->webSocket->enableAutomaticReconnection();
|
||||
this->webSocket->setUrl(host);
|
||||
this->webSocket->setOnMessageCallback(
|
||||
|
||||
Reference in new issue
Block a user