34 #include "../Exception.h" 35 #include "../Managers/FileDescriptorManager.h" 36 #include "../Encoding/Http.h" 127 uint32_t connectionBacklogSize = 100;
128 uint32_t maxConnections = 10;
129 uint32_t serverThreads = 1;
130 std::unordered_map<std::string, TcpSocket::PCertificateInfo>
certificates;
133 bool requireClientCert =
false;
152 void bind(std::string address, std::string port, std::string &listenAddress);
163 void startPrebound(std::string &listenAddress,
size_t processingThreads = 0);
165 void start(std::string address, std::string port, std::string &listenAddress,
size_t processingThreads = 0);
170 double GetPacketsPerMinuteReceived();
171 double GetPacketsPerMinuteSent();
172 double GetServerThreadLoad();
173 double GetProcessingThreadLoad();
174 double GetProcessingThreadLoadMax();
177 void send(int32_t clientId,
const std::vector<char> &packet,
bool closeConnection =
true);
179 std::string getClientCertDn(int32_t clientId);
180 std::string getClientCertSerial(int32_t clientId);
181 int64_t getClientCertExpiration(int32_t clientId);
197 void newConnection(int32_t clientId, std::string address, uint16_t port);
198 void connectionClosed(int32_t clientId);
This class provides a basic HTTP server.
Definition: HttpServer.h:123
This is the base library main class.
Definition: BaseLib.h:95
Definition: HttpServer.h:183
std::string dhParamData
Definition: HttpServer.h:132
std::mutex _httpClientInfoMutex
Definition: HttpServer.h:190
Definition: BaseLib.cpp:34
std::function< void(int32_t clientId)> _connectionClosedCallback
Definition: HttpServer.h:194
std::unordered_map< std::string, TcpSocket::PCertificateInfo > certificates
Definition: HttpServer.h:130
Exception class for the HTTP server.
Definition: HttpServer.h:48
std::function< void(int32_t clientId, std::string address, uint16_t port)> _newConnectionCallback
Definition: HttpServer.h:193
std::vector< uint8_t > TcpPacket
Definition: TcpSocket.h:172
std::shared_ptr< Http > http
Definition: HttpServer.h:184
std::function< void(int32_t clientId, std::string address, uint16_t port)> newConnectionCallback
Definition: HttpServer.h:135
std::string dhParamFile
Definition: HttpServer.h:131
std::shared_ptr< TcpSocket > _socket
Definition: HttpServer.h:188
std::function< void(int32_t clientId)> connectionClosedCallback
Definition: HttpServer.h:136
Definition: HttpServer.h:125
std::function< void(int32_t clientId, Http &http)> packetReceivedCallback
Definition: HttpServer.h:137
std::unordered_map< int32_t, HttpClientInfo > _httpClientInfo
Definition: HttpServer.h:191
Base class for all exceptions defined in Homegear.
Definition: Exception.h:41
std::function< void(int32_t clientId, Http &http)> _packetReceivedCallback
Definition: HttpServer.h:195
HttpServerException(std::string message)
Definition: HttpServer.h:50