#pragma once #include #include #include #include #include #if defined(BEAMMP_LINUX) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif #include #if defined(BEAMMP_LINUX) #pragma GCC diagnostic pop #endif namespace fs = std::filesystem; class TServer; class TNetwork; class TResourceManager; namespace Http { std::string GET(const std::string& host, int port, const std::string& target, unsigned int* status = nullptr); std::string POST(const std::string& host, int port, const std::string& target, const std::string& body, const std::string& ContentType, unsigned int* status = nullptr, const httplib::Headers& headers = {}); namespace Status { std::string ToString(int code); } const std::string ErrorString = "-1"; namespace Server { class THttpServerInstance { public: THttpServerInstance(TServer&, TNetwork&, TResourceManager&); ~THttpServerInstance(); static fs::path KeyFilePath; static fs::path CertFilePath; protected: void operator()(); private: std::thread mThread; TServer& mServer; TNetwork& mNetwork; TResourceManager& mResourceManager; }; } }