summaryrefslogtreecommitdiff
path: root/discord/websocket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'discord/websocket.cpp')
-rw-r--r--discord/websocket.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/discord/websocket.cpp b/discord/websocket.cpp
index 2dc4ad0..5cd82b1 100644
--- a/discord/websocket.cpp
+++ b/discord/websocket.cpp
@@ -7,9 +7,14 @@ void Websocket::StartConnection(std::string url) {
m_websocket.disableAutomaticReconnection();
m_websocket.setUrl(url);
m_websocket.setOnMessageCallback(std::bind(&Websocket::OnMessage, this, std::placeholders::_1));
+ m_websocket.setExtraHeaders(ix::WebSocketHttpHeaders { { "User-Agent", m_agent } }); // idk if this actually works
m_websocket.start();
}
+void Websocket::SetUserAgent(std::string agent) {
+ m_agent = agent;
+}
+
void Websocket::Stop() {
m_websocket.stop();
}