9 #ifndef CPPSERVER_HTTP_HTTPS_SERVER_H
10 #define CPPSERVER_HTTP_HTTPS_SERVER_H
14 #include "cache/filecache.h"
32 using SSLServer::SSLServer;
42 CppCommon::FileCache&
cache() noexcept {
return _cache; }
43 const CppCommon::FileCache&
cache() const noexcept {
return _cache; }
51 void AddStaticContent(
const CppCommon::Path& path,
const std::string& prefix =
"/",
const CppCommon::Timespan& timeout = CppCommon::Timespan::hours(1));
61 void Watchdog(
const CppCommon::UtcTimestamp& utc = CppCommon::UtcTimestamp()) { _cache.watchdog(utc); }
64 std::shared_ptr<Asio::SSLSession>
CreateSession(
const std::shared_ptr<Asio::SSLServer>& server)
override {
return std::make_shared<HTTPSSession>(std::dynamic_pointer_cast<HTTPSServer>(server)); }
68 CppCommon::FileCache _cache;
void AddStaticContent(const CppCommon::Path &path, const std::string &prefix="/", const CppCommon::Timespan &timeout=CppCommon::Timespan::hours(1))
Add static content cache.
HTTPSServer & operator=(const HTTPSServer &)=delete
HTTPSServer(HTTPSServer &&)=delete
std::shared_ptr< Asio::SSLSession > CreateSession(const std::shared_ptr< Asio::SSLServer > &server) override
const CppCommon::FileCache & cache() const noexcept
void ClearStaticContent()
Clear static content cache.
HTTPSServer & operator=(HTTPSServer &&)=delete
virtual ~HTTPSServer()=default
void Watchdog(const CppCommon::UtcTimestamp &utc=CppCommon::UtcTimestamp())
Watchdog the static content cache.
void RemoveStaticContent(const CppCommon::Path &path)
Remove static content cache.
HTTPSServer(const HTTPSServer &)=delete
CppCommon::FileCache & cache() noexcept
Get the static content cache.
HTTPS session definition.
C++ Server project definitions.