List webserver service on MDNS if enabled. (#3662)

This commit is contained in:
RoboMagus 2022-08-02 01:31:06 +02:00 committed by GitHub
parent 54427eac9a
commit 936c408a58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -68,6 +68,16 @@ void MDNSComponent::compile_records_() {
} }
#endif #endif
#ifdef USE_WEBSERVER
{
MDNSService service{};
service.service_type = "_http";
service.proto = "_tcp";
service.port = USE_WEBSERVER_PORT;
this->services_.push_back(service);
}
#endif
if (this->services_.empty()) { if (this->services_.empty()) {
// Publish "http" service if not using native API // Publish "http" service if not using native API
// This is just to have *some* mDNS service so that .local resolution works // This is just to have *some* mDNS service so that .local resolution works