Created
June 21, 2024 15:53
-
-
Save Hunter87ff/acc1ee92b52d846f23de694f763e7ef7 to your computer and use it in GitHub Desktop.
py web server port forwarding using localhost.run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # prompt: basic flask app | |
| import os | |
| from threading import Thread | |
| from flask import Flask | |
| app = Flask(__name__) | |
| @app.route('/') | |
| def hello_world(): | |
| return 'Hello, World!' | |
| def run():app.run(port=8000) | |
| Thread(target=run).start() | |
| os.system("ssh-keygen -R localhost.run") | |
| os.system("ssh -o StrictHostKeyChecking=no -R 80:localhost:8000 localhost.run") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment