64 {
65 using WebApp = apps::http::STREAM::WebApp;
66
67 const WebApp webApp(apps::http::STREAM::getWebApp(
"httpserver"));
68
70
72
74
75 {
76#if (STREAM_TYPE == TLS)
77 std::string cert = "/home/voc/projects/snodec/snode.c/certs/snode.c_-_server.pem";
78 std::string key = "/home/voc/projects/snodec/snode.c/certs/Volker_Christian_-_Web_-_snode.c_-_server.key.encrypted.pem";
79 std::string pass = "snode.c";
80
81 std::map<std::string, std::map<std::string, std::variant<std::string, bool, ssl_option_t>>> const sniCerts = {
82 {"snodec.home.vchrist.at", {{"Cert", cert}, {"CertKey", key}, {"CertKeyPassword", pass}}},
83 {"www.vchrist.at", {{"Cert", cert}, {"CertKey", key}, {"CertKeyPassword", pass}}}};
84
85
86#endif
87
89 for (std::string& route : webApp.getRoutes()) {
90 route.erase(std::remove(route.begin(), route.end(), '$'), route.end());
91
92 VLOG(1) <<
" " << route;
93 }
94
97 switch (state) {
98 case core::socket::State::OK:
99 VLOG(1) << instanceName << ": listening on '" << socketAddress.toString() << "'";
100 break;
101 case core::socket::State::DISABLED:
102 VLOG(1) << instanceName << ": disabled";
103 break;
104 case core::socket::State::ERROR:
105 VLOG(1) << instanceName << ": " << socketAddress.toString() << ": " << state.what();
106 break;
107 case core::socket::State::FATAL:
108 VLOG(1) << instanceName << ": " << socketAddress.toString() << ": " << state.what();
109 break;
110 }
111 });
112 }
113
115}
static void init(int argc, char *argv[])
static int start(const utils::Timeval &timeOut={LONG_MAX, 0})
std::string getHtmlRoot()