The concept is port forwarding.
First you need to know your public IP using https://www.whatsmyip.org/
Second, access the router settings where you want the ESP8266 to connect
Third, navigate to the "forwarding" tab then Virtual server. there you can input the public IP address and the Port you want to expose to public.
Finally, access the ESP8266 anywhere by typing the IP:Port in the browser
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…