Merge pull request #1220 from kiwix/feature/libkiwix-sync

Add support for new getBestPublicIp
This commit is contained in:
Kelson 2024-09-29 13:49:45 +00:00 committed by GitHub
commit b2c7e94cf0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -88,7 +88,7 @@ void LocalKiwixServer::runOrStopServer()
settingsManager->setKiwixServerPort(m_port);
settingsManager->setKiwixServerIpAddress(m_ipAddress);
mp_server->setAddress(m_ipAddress.toStdString());
m_ipAddress = (m_ipAddress != "0.0.0.0") ? m_ipAddress : QString::fromStdString(kiwix::getBestPublicIp(false));
m_ipAddress = (m_ipAddress != "0.0.0.0") ? m_ipAddress : QString::fromStdString(kiwix::getBestPublicIp());
ui->IpAddress->setText("http://" + m_ipAddress + ":" + QString::number(m_port));
ui->IpAddress->setReadOnly(true);
if (!mp_server->start()) {