diff --git a/source/relay/sessions_worker.cc b/source/relay/sessions_worker.cc index 3588fee413..07ff5a4688 100644 --- a/source/relay/sessions_worker.cc +++ b/source/relay/sessions_worker.cc @@ -78,14 +78,23 @@ void SessionsWorker::onBeforeThreadRunning() self_task_runner_ = thread_->taskRunner(); DCHECK(self_task_runner_); - std::error_code error_code; - asio::ip::address listen_address = - asio::ip::make_address(base::local8BitFromUtf16(listen_interface_), error_code); - if (error_code) + asio::ip::address listen_address; + + if (!listen_interface_.empty()) { - LOG(LS_ERROR) << "Unable to get listen address: " - << base::utf16FromLocal8Bit(error_code.message()); - return; + std::error_code error_code; + listen_address = asio::ip::make_address( + base::local8BitFromUtf16(listen_interface_), error_code); + if (error_code) + { + LOG(LS_ERROR) << "Unable to get listen address: " + << base::utf16FromLocal8Bit(error_code.message()); + return; + } + } + else + { + listen_address = asio::ip::address_v6::any(); } session_manager_ = std::make_unique(