I have been working on a project which basically allows me to connect the esp8266 module to my home wifi and from there I can interact with it through a webpage, 192.168.4.1.
I don't know a whole lot about networks, so:
How do I connect to the web server from outside my home wifi?
This is what I'm thinking: (typed into searchbar)
121.211.10.43:192.168.4.1
public ip : local ip
Sorry if this question is very broad, or put badly.
I think the typical setup to access an ESP board from the outside world is to connect the esp to your network router as a web server. Then in your router setup you will need to port forward incoming request to the local network IP address of the esp. A dynamic IP address service is typically used to give your network an internet address.
On my router, I am able to limit the IP addresses it gives out via DCHP.
After doing that, I am thinking the OP would give the ESP8266 module a static IP address that is outside that range but within the range of the router.
Example, router's IP is 192.168.1.1
set IP range from 192.168.1.2 to 192.168.1.199
Set ESP8266 to 192.168.1.200
How do I connect to the web server from outside my home wifi?
You shouldn't do that. With most home routers you have the option to forward some ports to some internal devices (read the routers manual for this) but that breaks the security and is not a final solution as most home users don't have a fixed IP address but this is changing from time to time (dynamic IP). There are solutions for this (dynamic DNS) but you should definitely use a more secure solution. One may be a VPN, another may be that you don't connect to the ESP directly but both you and the ESP connect to some external internet service.