#include #include #include "server/src/server.h" #include "server/src/handler.h" using namespace ts::dns; std::vector bindings() { std::vector result{}; { sockaddr_in& any_v4{reinterpret_cast(result.emplace_back())}; memset(&any_v4, 0, sizeof(sockaddr_in)); any_v4.sin_family = AF_INET; any_v4.sin_port = htons(1222); //htons(53); any_v4.sin_addr.s_addr = (1UL << 24U) | 127U; } return result; } int main() { std::string error{}; auto handler = std::make_shared(); WebDNSServer server{handler}; if(!server.start(bindings(), error)) { for(auto& binding : server.bindings()) std::cout << " - " << binding->error << "\n"; std::cerr << "Failed to start server: " << error << "\n"; return 1; } std::this_thread::sleep_for(std::chrono::seconds{100}); return 0; }