summaryrefslogtreecommitdiff
path: root/protocols/Discord
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-10-08 20:37:59 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-10-08 20:37:59 +0300
commit6f8955cdc2e8bcdeaa15a06d0f1badf13d14cb5c (patch)
tree40bf8fd1196e87d66b412d07adfbca24195ba1f6 /protocols/Discord
parentbb3b89fd5d857d396050d02bc185d765760de6ff (diff)
first version of WA that connects
Diffstat (limited to 'protocols/Discord')
-rw-r--r--protocols/Discord/src/gateway.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/protocols/Discord/src/gateway.cpp b/protocols/Discord/src/gateway.cpp
index c713ce79d0..cd01f729c0 100644
--- a/protocols/Discord/src/gateway.cpp
+++ b/protocols/Discord/src/gateway.cpp
@@ -41,9 +41,17 @@ void CDiscordProto::GatewayThread(void*)
bool CDiscordProto::GatewayThreadWorker()
{
- m_hGatewayConnection = WebSocket_Connect(m_hGatewayNetlibUser, m_szGateway + "/?encoding=json&v=6");
- if (m_hGatewayConnection == nullptr)
+ NETLIBHTTPHEADER hdrs[] =
+ {
+ { "Sec-WebSocket-Key", "KFShSwLlp4E6C7JZc5h4sg==" },
+ { 0, 0 }
+ };
+
+ m_hGatewayConnection = WebSocket_Connect(m_hGatewayNetlibUser, m_szGateway + "/?encoding=json&v=6", hdrs);
+ if (m_hGatewayConnection == nullptr) {
debugLogA("Gateway connection failed, exiting");
+ return false;
+ }
debugLogA("Gateway connection succeeded");