Mon Feb 19, 2018 1:53 pm
Edit - topguy already said all this!
Consider the security implications.
There are plenty of people who would love to control not just your GPIO pins, but every computer, light bulb and smart toaster on your network.
Firstly your router has to have port forwarding set up to allow HTTP (Port 80?) or HTTPS connections through to the Pi.
As your ISP probably doesn't give you a static IP address, you need a way to connect to your router when it's exterrnal IP changes. One way to do that is to use a dynamic DNS service such as duckdns.org. And your PI or another computer on your network has to keep track of IP address changes and update duckdns. With this in place, you should be able to connect to (for example) mninbiti.duckdns.org rather than the IP address.