Skip to content

Commit f9a7faa

Browse files
authored
Merge pull request #20 from thijstriemstra/patch-1
support custom mdns hostname
2 parents 6c960d9 + 64aec60 commit f9a7faa

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/FastLEDHub.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void FastLEDHubClass::initialize(const String &projectName, bool enableGammaCorr
2626
Config.initialize();
2727
if (WiFi.status() == WL_CONNECTED)
2828
{
29-
WebSocket::initialize();
29+
WebSocket::initialize(projectName);
3030
Webserver::initialize();
3131
Fade::initialize();
3232
}

src/WebSocket.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ namespace WebSocket
115115

116116
} // namespace
117117

118-
void initialize()
118+
void initialize(const String &hostname)
119119
{
120120
m_socket.begin();
121121
m_socket.onEvent(onEvent);
122-
MDNS.begin("fastledhub");
122+
MDNS.begin(hostname);
123123
MDNS.addService("http", "tcp", 80);
124124
MDNS.addService("ws", "tcp", 81);
125125
}

src/WebSocket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace WebSocket
77
{
88

99
/// Initialize the websocket instance
10-
void initialize();
10+
void initialize(const String &hostname = "fastledhub");
1111

1212
/// Handle websocket
1313
void handle();

0 commit comments

Comments
 (0)