SBind(sock, local);
SListen(sock, 5);
auto launch=[sock, local, password, apiKey, customHeaders]() {
- thread t(dnsdistWebserverThread, sock, local, password, apiKey ? *apiKey : "", customHeaders);
+ setWebserverConfig(password, apiKey, customHeaders);
+ thread t(dnsdistWebserverThread, sock, local);
t.detach();
};
if(g_launchWork)
});
+ g_lua.writeFunction("setWebserverConfig", [](const std::string& password, const boost::optional<std::string> apiKey, const boost::optional<std::map<std::string, std::string> > customHeaders) {
+ setLuaSideEffect();
+ setWebserverConfig(password, apiKey, customHeaders);
+ });
+
g_lua.writeFunction("controlSocket", [client](const std::string& str) {
setLuaSideEffect();
ComboAddress local(str, 5199);