What are you using as a localhost server? I know that some, e.g. Wampserver, require you to change a setting to make them publicly accessible as a security feature. BitNami's LAMP, WAMP, and MAMP stacks are "online" by default.
Additionally, most ISPs are generally not happy for their customers to use their connections to serve websites, and they may have some clause in the small print of your ToS prohibiting this.
BTW, I'm currently looking for a shared hosting provider that can run Moodle 2.6 and later without any problems (Discussion: https://moodle.org/mod/forum/discuss.php?d=255412 ). Please let me know if you have any recommendations