set user-agent through ini

This commit is contained in:
ouwou
2020-11-27 01:37:01 -05:00
parent 1463d8da9e
commit ae77bfd1d1
7 changed files with 46 additions and 10 deletions

View File

@@ -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();
}