when using
if(MDNS.begin("echo",WiFi.localIP())){
Serial.println("MDNS Responder Started");
}
so if want to connect to server then just write echo.local:80
so is there a way to change .local to .com?
when using
if(MDNS.begin("echo",WiFi.localIP())){
Serial.println("MDNS Responder Started");
}
so if want to connect to server then just write echo.local:80
so is there a way to change .local to .com?
No, the .local is defined by the mDNS system. .com is defined in the DNS system which you probably cannot influence from your ESP8266.
I tried javascript websocket connecting esp8266 websocket server using IP so it is working but as you know ip address may changed when router rebooted so I tried to use mDNS but javascript not accept connection if use esp8266.local:81 instead of 192.168.1.3:81
is there any suggestion?
In above code excerpt you used "echo" instead of "esp8266". Also as mDNS might not be part of the OS name resolution it may not work for Javascript connections. It may even depend on the browser you use. At least on Linux and Windows the resolution works on system level so the browser should be able to open the websocket to an mDNS hostname.
Before you try it in the browser, open a command line and ping the name. If that works try it in a websocket. If the ping doesn't work you should provide more details about your network and your (complete) code.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.