From 6f8955cdc2e8bcdeaa15a06d0f1badf13d14cb5c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 8 Oct 2019 20:37:59 +0300 Subject: first version of WA that connects --- protocols/Discord/src/gateway.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'protocols/Discord/src') 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"); -- cgit v1.2.3