mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-03 14:26:09 +00:00
Add preliminary work for HTTP health endpoint (#68)
* Add preliminary work for HTTP health endpoint * Http: Fix infinite loop bug in Tx509KeypairGenerator::generateKey() * update commandline * Add TLS Support class for use with http server * Add preliminary HTTP Server; TLS still broken; fix in later commit * Fix TLS handshake, due to server being unable to serve key/certfile in 'Http.h/Http.cpp'; Cause was httlib not being threadsafe due to being a blocking http library * Run clang format * Add option to configure http server port via ServerConfig * TConfig: add HTTPServerPort to config parsing step * Fix SSL Cert / Key path not auto generating when not existing * Add health endpoint; Fix SSL Cert serial no. not refreshing when regenerating * Switch arround status codes in /health route * Run clang format Co-authored-by: Lion Kortlepel <development@kortlepel.com>
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <thread>
|
||||
|
||||
#define CPPHTTPLIB_OPENSSL_SUPPORT 1
|
||||
static const std::string sCommandlineArguments = R"(
|
||||
USAGE:
|
||||
BeamMP-Server [arguments]
|
||||
@@ -155,6 +155,12 @@ int BeamMPServerMain(MainArguments Arguments) {
|
||||
Application::Console().InitializeLuaConsole(LuaEngine);
|
||||
Application::CheckForUpdates();
|
||||
|
||||
Http::Server::SetupEnvironment();
|
||||
Http::Server::THttpServerInstance HttpServerInstance {};
|
||||
|
||||
beammp_debug("cert.pem is " + std::to_string(fs::file_size("cert.pem")) + " bytes");
|
||||
beammp_debug("key.pem is " + std::to_string(fs::file_size("key.pem")) + " bytes");
|
||||
|
||||
RegisterThread("Main(Waiting)");
|
||||
|
||||
while (!Shutdown) {
|
||||
|
||||
Reference in New Issue
Block a user