add MP.HttpsGET, MP.HttpsPOST

This commit is contained in:
Lion Kortlepel
2021-07-01 00:33:28 +02:00
parent 8853cef809
commit 44e0f3aa21
5 changed files with 188 additions and 42 deletions

View File

@@ -35,12 +35,12 @@ void THeartbeatThread::operator()() {
Body += "&pps=" + Application::PPS();
T = Http::POST(Application::GetBackendHostname(), "/heartbeat", {}, Body, "application/x-www-form-urlencoded");
T = Http::POST(Application::GetBackendHostname(), 443, "/heartbeat", {}, Body, "application/x-www-form-urlencoded");
if (T.substr(0, 2) != "20") {
//Backend system refused server startup!
std::this_thread::sleep_for(std::chrono::milliseconds(500));
T = Http::POST(Application::GetBackendHostname(), "/heartbeat", {}, Body, "application/x-www-form-urlencoded");
T = Http::POST(Application::GetBackendHostname(), 443, "/heartbeat", {}, Body, "application/x-www-form-urlencoded");
// TODO backup2 + HTTP flag (no TSL)
if (T.substr(0, 2) != "20") {
warn("Backend system refused server! Server might not show in the public list");