Füge Unterstützung für SSL/TLS in den WebSocket-Server hinzu. Aktualisiere die Konfigurationsdatei, um SSL-Optionen zu ermöglichen, und passe die WebSocketServer-Klasse an, um Zertifikat- und Schlüsselpfade zu akzeptieren. Verbessere die Serverstartlogik, um SSL korrekt zu initialisieren und entsprechende Meldungen auszugeben.
This commit is contained in:
committed by
Torsten (PC)
parent
92e17a9f43
commit
8212e906a3
@@ -25,7 +25,8 @@ class Worker; // forward
|
||||
|
||||
class WebSocketServer {
|
||||
public:
|
||||
WebSocketServer(int port, ConnectionPool &pool, MessageBroker &broker);
|
||||
WebSocketServer(int port, ConnectionPool &pool, MessageBroker &broker,
|
||||
bool useSSL = false, const std::string& certPath = "", const std::string& keyPath = "");
|
||||
~WebSocketServer();
|
||||
|
||||
void run();
|
||||
@@ -46,6 +47,9 @@ private:
|
||||
int port;
|
||||
ConnectionPool &pool;
|
||||
MessageBroker &broker;
|
||||
bool useSSL;
|
||||
std::string certPath;
|
||||
std::string keyPath;
|
||||
|
||||
std::atomic<bool> running{false};
|
||||
struct lws_context *context = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user