Add client support for websockets

This commit is contained in:
badaix 2025-01-23 22:13:05 +01:00
parent 9fbf273caa
commit 6c02252d84
13 changed files with 393 additions and 118 deletions

View file

@ -354,14 +354,17 @@ void Controller::start()
settings_.server.host = host;
settings_.server.port = port;
LOG(INFO, LOG_TAG) << "Found server " << settings_.server.host << ":" << settings_.server.port << "\n";
clientConnection_ = make_unique<ClientConnection>(io_context_, settings_.server);
clientConnection_ = make_unique<ClientConnectionTcp>(io_context_, settings_.server);
worker();
}
});
}
else
{
clientConnection_ = make_unique<ClientConnection>(io_context_, settings_.server);
if (settings_.server.protocol == "ws")
clientConnection_ = make_unique<ClientConnectionWs>(io_context_, settings_.server);
else
clientConnection_ = make_unique<ClientConnectionTcp>(io_context_, settings_.server);
worker();
}
}