update submodules, remove ssl crap

This commit is contained in:
Lion Kortlepel
2022-05-26 11:59:36 +02:00
parent 4f69ca1ad0
commit a0876ed58c
10 changed files with 9 additions and 17 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ include_directories("${PROJECT_SOURCE_DIR}/deps/cpp-httplib")
include_directories("${PROJECT_SOURCE_DIR}/deps/json/single_include") include_directories("${PROJECT_SOURCE_DIR}/deps/json/single_include")
include_directories("${PROJECT_SOURCE_DIR}/deps") include_directories("${PROJECT_SOURCE_DIR}/deps")
add_compile_definitions(CPPHTTPLIB_OPENSSL_SUPPORT) add_compile_definitions(CPPHTTPLIB_OPENSSL_SUPPORT=1)
# ------------------------ APPLE --------------------------------- # ------------------------ APPLE ---------------------------------
if(APPLE) if(APPLE)
Vendored
+1 -1
Submodule deps/fmt updated: 17dda58391...ce246aaf74
Vendored
+1 -1
Submodule deps/json updated: eb21824147...31e25839b6
Vendored
+1 -1
Submodule deps/sol2 updated: c068aefbed...d0eba0a754
Vendored
+1 -1
-2
View File
@@ -29,8 +29,6 @@ namespace Server {
class THttpServerInstance { class THttpServerInstance {
public: public:
THttpServerInstance(); THttpServerInstance();
static fs::path KeyFilePath;
static fs::path CertFilePath;
protected: protected:
void operator()(); void operator()();
-6
View File
@@ -151,13 +151,7 @@ Http::Server::THttpServerInstance::THttpServerInstance() {
void Http::Server::THttpServerInstance::operator()() try { void Http::Server::THttpServerInstance::operator()() try {
beammp_info("HTTP(S) Server started on port " + std::to_string(Application::Settings.HTTPServerPort)); beammp_info("HTTP(S) Server started on port " + std::to_string(Application::Settings.HTTPServerPort));
std::unique_ptr<httplib::Server> HttpLibServerInstance; std::unique_ptr<httplib::Server> HttpLibServerInstance;
if (Application::Settings.HTTPServerUseSSL) {
HttpLibServerInstance = std::make_unique<httplib::SSLServer>(
reinterpret_cast<const char*>(Http::Server::THttpServerInstance::CertFilePath.c_str()),
reinterpret_cast<const char*>(Http::Server::THttpServerInstance::KeyFilePath.c_str()));
} else {
HttpLibServerInstance = std::make_unique<httplib::Server>(); HttpLibServerInstance = std::make_unique<httplib::Server>();
}
// todo: make this IP agnostic so people can set their own IP // todo: make this IP agnostic so people can set their own IP
HttpLibServerInstance->Get("/", [](const httplib::Request&, httplib::Response& res) { HttpLibServerInstance->Get("/", [](const httplib::Request&, httplib::Response& res) {
res.set_content("<!DOCTYPE html><article><h1>Hello World!</h1><section><p>BeamMP Server can now serve HTTP requests!</p></section></article></html>", "text/html"); res.set_content("<!DOCTYPE html><article><h1>Hello World!</h1><section><p>BeamMP Server can now serve HTTP requests!</p></section></article></html>", "text/html");
+1 -1
View File
@@ -17,7 +17,7 @@
#include <iostream> #include <iostream>
#include <thread> #include <thread>
#define CPPHTTPLIB_OPENSSL_SUPPORT 1
static const std::string sCommandlineArguments = R"( static const std::string sCommandlineArguments = R"(
USAGE: USAGE:
BeamMP-Server [arguments] BeamMP-Server [arguments]