can send a response, cannot process body yet

This commit is contained in:
Benjamin Sergeant
2019-06-20 16:20:04 -07:00
parent 44f37a4140
commit 74cc6b815a
12 changed files with 146 additions and 141 deletions

View File

@ -68,6 +68,7 @@ add_executable(ws
ws_cobra_to_statsd.cpp
ws_cobra_to_sentry.cpp
ws_snake.cpp
ws_httpd.cpp
ws.cpp)
target_link_libraries(ws ixwebsocket)

View File

@ -216,6 +216,10 @@ int main(int argc, char** argv)
->check(CLI::ExistingPath);
runApp->add_flag("-v", verbose, "Verbose");
CLI::App* httpServerApp = app.add_subcommand("httpd", "HTTP server");
httpServerApp->add_option("--port", port, "Port");
httpServerApp->add_option("--host", hostname, "Hostname");
CLI11_PARSE(app, argc, argv);
// pid file handling
@ -313,6 +317,10 @@ int main(int argc, char** argv)
redisPassword, verbose,
appsConfigPath);
}
else if (app.got_subcommand("httpd"))
{
ret = ix::ws_httpd_main(port, hostname);
}
ix::uninitNetSystem();
return ret;

View File

@ -93,4 +93,6 @@ namespace ix
const std::string& redisPassword,
bool verbose,
const std::string& appsConfigPath);
int ws_httpd_main(int port, const std::string& hostname);
} // namespace ix