A minor improvement on the flask-ngrok tool for tunneling Flask web apps to public URLs. Added support for ngrok configs, such as authentication, custom domains, and logging; can run on Jupyter clients such as Colab.
pip install flask-tunnel
from flask import Flask
from flask_tunnel import FlaskTunnel
app = Flask(__name__)
FlaskTunnel(app, auth="#####", subdomain="flask-tunnel")
@app.route("/")
def hello():
return "Hello World"
app.run(port=5000)
For details on using the config
parameter of FlaskTunnel
, see pyngrok's documentation on PyngrokConfig
.