Füge Unterstützung für SSL/TLS in die Konfiguration und das Build-System ein
- Integriere die libwebsockets-Bibliothek für SSL/TLS WebSocket-Unterstützung in `CMakeLists.txt`. - Aktualisiere `chatconfig.json`, um SSL-Optionen wie `ssl_enabled`, `ssl_cert_path` und `ssl_key_path` hinzuzufügen. - Ergänze das `deploy.sh`-Skript um einen Schritt zur optionalen Einrichtung von SSL/TLS. - Modifiziere `update_config.sh`, um die SSL-Konfiguration in die Servereinstellungen zu integrieren. - Implementiere eine Überprüfung in `main.cpp`, um den SSL-Status zu prüfen und entsprechende Meldungen auszugeben.
This commit is contained in:
13
src/main.cpp
13
src/main.cpp
@@ -2,13 +2,26 @@
|
||||
#include "core/config.h"
|
||||
#include "core/server.h"
|
||||
#include "lib/database.h"
|
||||
#include <iostream>
|
||||
|
||||
// main function
|
||||
int main(int, char **) {
|
||||
auto config = std::make_shared<Yc::Lib::Config>();
|
||||
auto database = std::make_shared<Yc::Lib::Database>(config);
|
||||
|
||||
// Check if SSL is enabled (for future implementation)
|
||||
bool sslEnabled = config->value("server", "ssl_enabled").asBool();
|
||||
|
||||
if (sslEnabled) {
|
||||
std::cout << "[YourChat] SSL/TLS support is configured but not yet implemented" << std::endl;
|
||||
std::cout << "[YourChat] Starting without SSL/TLS support" << std::endl;
|
||||
} else {
|
||||
std::cout << "[YourChat] Starting without SSL/TLS support" << std::endl;
|
||||
}
|
||||
|
||||
auto server = std::make_shared<Yc::Lib::Server>(config, database);
|
||||
server->createRooms(config->group("rooms"));
|
||||
server->run();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user