Localtunnel is a neat tool you can use to quickly share your local Flask server with a friend.
To install Localtunnel, open a terminal and run the following command:
sudo gem install localtunnel
Then, with Flask running at http://localhost:5000, open a new Terminal window and type
localtunnel 5000
Port 5000 is now publicly accessible from http://54xy.localtunnel.com ...
(Get a gem: command not found error? Download RubyGems
here.)
If you load the URL given in the localtunnel output in your browser, you should see your Flask app. It's actually being loaded from your own computer!
This snippet by Kevin Burke can be used freely for anything you like. Consider it public domain.
Comments
Advantage over port forwarding on router? by Alex Kelley on 2013-04-01 @ 17:09
Hello Kevin,
One advantage over enabling port forwarding on a router I see with using Localtunnel would be that you could run multiple web servers behind a single router (I don't think this is possible with port forwarding). I'm interested in other advantages you see with the Localtunnel option. Any security advantages?
Thanks for your feedback!