39 {
40 using WebApp = apps::http::STREAM::WebApp;
41
42 const WebApp webApp(apps::http::STREAM::getWebApp(
"httpserver"));
43
45 CLI::Option* htmlRoot = configWeb.
addOption(
"--html-root",
"HTML root directory",
"path",
"");
47
49
51
52 {
53#if (STREAM_TYPE == TLS)
54 std::string cert = "/home/voc/projects/snodec/snode.c/certs/snode.c_-_server.pem";
55 std::string key = "/home/voc/projects/snodec/snode.c/certs/Volker_Christian_-_Web_-_snode.c_-_server.key.encrypted.pem";
56 std::string pass = "snode.c";
57
58 std::map<std::string, std::map<std::string, std::variant<std::string, bool, ssl_option_t>>> sniCerts = {
59 {"snodec.home.vchrist.at", {{"Cert", cert}, {"CertKey", key}, {"CertKeyPassword", pass}}},
60 {"www.vchrist.at", {{"Cert", cert}, {"CertKey", key}, {"CertKeyPassword", pass}}}};
61
62 webApp.getConfig().addSniCerts(sniCerts);
63#endif
64
67 switch (state) {
68 case core::socket::State::OK:
69 VLOG(1) << instanceName << ": listening on '" << socketAddress.toString() << "'";
70 break;
71 case core::socket::State::DISABLED:
72 VLOG(1) << instanceName << ": disabled";
73 break;
74 case core::socket::State::ERROR:
75 VLOG(1) << instanceName << ": " << socketAddress.toString() << ": " << state.what();
76 break;
77 case core::socket::State::FATAL:
78 VLOG(1) << instanceName << ": " << socketAddress.toString() << ": " << state.what();
79 break;
80 }
81 });
82 }
84}
static void init(int argc, char *argv[])
static int start(const utils::Timeval &timeOut={LONG_MAX, 0})
CLI::Option * addOption(const std::string &name, const std::string &description)
void required(CLI::Option *opt, bool req=true)