mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
@@ -11,6 +11,7 @@
|
||||
#include <QHostInfo>
|
||||
#include <bonjour/bonjourserviceregister.h>
|
||||
#include <bonjour/bonjourrecord.h>
|
||||
#include <HyperionConfig.h>
|
||||
#include <exception>
|
||||
|
||||
StaticFileServing::StaticFileServing (Hyperion *hyperion, QString baseUrl, quint16 port, QObject * parent)
|
||||
@@ -47,10 +48,16 @@ void StaticFileServing::onServerStarted (quint16 port)
|
||||
const QJsonObject & generalConfig = _hyperion->getQJsonConfig()["general"].toObject();
|
||||
const QString mDNSDescr = generalConfig["name"].toString("") + "@" + QHostInfo::localHostName() + ":" + QString::number(port);
|
||||
|
||||
// txt record for zeroconf
|
||||
QString id = _hyperion->id;
|
||||
std::string version = HYPERION_VERSION;
|
||||
std::vector<std::pair<std::string, std::string> > txtRecord = {{"id",id.toStdString()},{"version",version}};
|
||||
|
||||
BonjourServiceRegister *bonjourRegister_http = new BonjourServiceRegister();
|
||||
bonjourRegister_http->registerService(
|
||||
BonjourRecord(mDNSDescr, "_hyperiond-http._tcp", QString()),
|
||||
port
|
||||
port,
|
||||
txtRecord
|
||||
);
|
||||
Debug(_log, "Web Config mDNS responder started");
|
||||
}
|
||||
|
Reference in New Issue
Block a user