Add listen(host, port, callback)
This commit is contained in:
@@ -268,6 +268,13 @@ public:
|
||||
return std::move(*this);
|
||||
}
|
||||
|
||||
/* Host, port, callback */
|
||||
TemplatedApp &&listen(std::string host, int port, fu2::unique_function<void(us_listen_socket *)> &&handler) {
|
||||
handler(httpContext->listen(host.c_str(), port, 0));
|
||||
return std::move(*this);
|
||||
}
|
||||
|
||||
/* Port, callback */
|
||||
TemplatedApp &&listen(int port, fu2::unique_function<void(us_listen_socket *)> &&handler) {
|
||||
handler(httpContext->listen(nullptr, port, 0));
|
||||
return std::move(*this);
|
||||
|
||||
Reference in New Issue
Block a user