mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Added avahi/bonjour advertisement to webconfig (#258)
This commit is contained in:
parent
d095b355b1
commit
6a26e4fd5f
@ -8,6 +8,10 @@
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QResource>
|
||||
#include <QHostInfo>
|
||||
#include <bonjour/bonjourserviceregister.h>
|
||||
#include <bonjour/bonjourrecord.h>
|
||||
|
||||
|
||||
StaticFileServing::StaticFileServing (Hyperion *hyperion, QString baseUrl, quint16 port, QObject * parent)
|
||||
: QObject (parent)
|
||||
@ -40,6 +44,18 @@ StaticFileServing::~StaticFileServing ()
|
||||
void StaticFileServing::onServerStarted (quint16 port)
|
||||
{
|
||||
Info(_log, "started on port %d name \"%s\"", port ,_server->getServerName().toStdString().c_str());
|
||||
|
||||
const std::string mDNSDescr = ( _server->getServerName().toStdString()
|
||||
+ "@" +
|
||||
QHostInfo::localHostName().toStdString()
|
||||
);
|
||||
|
||||
BonjourServiceRegister *bonjourRegister_http = new BonjourServiceRegister();
|
||||
bonjourRegister_http->registerService(
|
||||
BonjourRecord(mDNSDescr.c_str(), "_http._tcp", QString()),
|
||||
port
|
||||
);
|
||||
Debug(_log, "Web Config mDNS responder started");
|
||||
}
|
||||
|
||||
void StaticFileServing::onServerStopped () {
|
||||
|
Loading…
Reference in New Issue
Block a user