Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/confighttp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1739,11 +1739,15 @@ namespace confighttp {
server.config.address = net::get_bind_address(address_family);
server.config.port = port_https;

// Store bind address for logging, use "localhost" as fallback for wildcard addresses
const auto bind_addr = server.config.address;
const auto display_addr = config::sunshine.bind_address.empty() ? "localhost"sv : std::string_view {bind_addr};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you check if the function mentioned in #4638 (comment) would return what we need?


auto accept_and_run = [&](auto *server) {
try {
platf::set_thread_name("confighttp::tcp");
server->start([](const unsigned short port) {
BOOST_LOG(info) << "Configuration UI available at [https://localhost:"sv << port << "]";
server->start([&display_addr](const unsigned short port) {
BOOST_LOG(info) << "Configuration UI available at [https://"sv << display_addr << ":" << port << "]";
});
} catch (boost::system::system_error &err) {
// It's possible the exception gets thrown after calling server->stop() from a different thread
Expand Down