Is there any example code for websocket & mdns for esp8266

I want to connect with esp8266 server like ws://esp8266.local:81 instead of ws://192.168.0.2:81
is there any working example?
thanks
is there any working example?
thanks
Open Community Forum for ESP8266, Come share Arduino and IoT (Internet of Things)
https://www.esp8266.com/
#include <ESP8266mDNS.h>
void setup() {
// Start the Wi-Fi connection
WiFi.begin("your_SSID", "your_password");
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
}
// Start the mDNS responder
if (MDNS.begin("esp8266")) {
Serial.println("mDNS responder started");
} else {
Serial.println("Error setting up mDNS responder!");
}
}
void loop() {
// Your code here
}