Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By Focak
#46490 Yes I can connect to webserver also websocket succsessfuly made connection when I am outside my network and using dns-host , but when I am inside my local network I only connect to webserver then websockets can not make connection. I need to use dns host because my public IP is changing every 24 hours.
User avatar
By martinayotte
#46492 So, it is the same issue I have, and I don't know any workaround, except not using external dns name on the client when located inside the network.
BTW, you didn't mentioned what his your client, is it another ESP or a mobile phone or even a laptop ?
Because the issue isn't on ESP server, it is on the client, so the simplest workaround is to figure out if the client is inside or outside and switch URL accordingly.

EDIT : Oupps ! I've just realized ... your URL is located in a Javascript provided by your ESP ...
Than, the switch can be done there : your ESP need to figure out the RemoteIP and decide which URL need to be sent in the Web page according to either the IP is internal or not ... ;)