Enable validation according to WebSocket resource and origin.

This commit is contained in:
lotodore
2013-10-05 16:42:05 +02:00
parent 2c5dcc2ba0
commit a6f3536290
8 changed files with 33 additions and 13 deletions
+4 -2
View File
@@ -78,7 +78,8 @@ ServerManager::~ServerManager()
}
void
ServerManager::Init(unsigned serverPort, unsigned websocketPort, bool ipv6, int proto, const string &logDir)
ServerManager::Init(unsigned serverPort, unsigned websocketPort, bool ipv6, int proto, const string &logDir,
const string &webSocketResource, const string &webSocketOrigin)
{
GetLobbyThread().Init(logDir);
@@ -95,7 +96,8 @@ ServerManager::Init(unsigned serverPort, unsigned websocketPort, bool ipv6, int
}*/
if (proto & TRANSPORT_PROTOCOL_WEBSOCKET)
{
boost::shared_ptr<ServerAcceptInterface> webAcceptHelper(new ServerAcceptWebHelper(GetGui(), m_ioService));
boost::shared_ptr<ServerAcceptInterface> webAcceptHelper(
new ServerAcceptWebHelper(GetGui(), m_ioService, webSocketResource, webSocketOrigin));
webAcceptHelper->Listen(websocketPort, ipv6, logDir, m_lobbyThread);
m_acceptHelperPool.push_back(webAcceptHelper);
}