File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -816,6 +816,16 @@ bool webServerAssignResources(int httpPort = 80)
816816 /* https://github.com/espressif/arduino-esp32/blob/master/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino
817817 */
818818
819+ if (MDNS.begin (&settings.mdnsHostName [0 ]) == false )
820+ {
821+ systemPrintln (" Error setting up MDNS responder!" );
822+ }
823+ else
824+ {
825+ // if (settings.debugNetworkLayer)
826+ systemPrintf (" mDNS started as %s.local\r\n " , settings.mdnsHostName );
827+ }
828+
819829 webServer = new WebServer (httpPort);
820830 if (!webServer)
821831 {
@@ -927,6 +937,9 @@ bool webServerAssignResources(int httpPort = 80)
927937 // Start the web server
928938 webServer->begin ();
929939
940+ if (settings.mdnsEnable == true )
941+ MDNS.addService (" http" , " tcp" , settings.httpPort ); // Add service to MDNS
942+
930943 // Starts task for updating webServer with handleClient
931944 if (task.updateWebServerTaskRunning == false )
932945 xTaskCreate (updateWebServerTask,
You can’t perform that action at this time.
0 commit comments