Your public ip address is assigned to your router. When you try to use that from within your network it will connect to your router. Your router will not forward any ports when connected to from within the network, so you have to use the local IP from within the network.
If it is working from within the network then it is likely to be working from outside, assuming you have to correct ports forwarded etc... which it sounds like you have done - also dont forget to open the ports on your firewall. The only true way to test it is working is to try and connect to it using a computer outside of your LAN.