Flask Snippets

Snippets are unofficial and unmaintained.

This is an archived view of user-submitted snippets. Despite being hosted on the Flask site, they are not official. No Flask maintainer has curated or checked the snippets for security, correctness, or design.

Share your Local Server with a Friend

Posted by Kevin Burke on 2012-03-12 @ 06:14 and filed in Utilities

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.