add HTTP server

This commit is contained in:
Martin Michelsen
2024-02-18 21:33:15 -08:00
parent bd13950ba6
commit f16b8ef983
21 changed files with 1290 additions and 266 deletions
+10
View File
@@ -615,6 +615,16 @@ void ServerState::load_config() {
}
} catch (const out_of_range&) {
}
try {
for (const auto& item : json.at("HTTPListen").as_list()) {
if (item->is_int()) {
this->http_addresses.emplace_back(string_printf("0.0.0.0:%" PRId64, item->as_int()));
} else {
this->http_addresses.emplace_back(item->as_string());
}
}
} catch (const out_of_range&) {
}
}
auto local_address_str = json.at("LocalAddress").as_string();