Skip to content

Instantly share code, notes, and snippets.

@Hunter87ff
Created June 21, 2024 15:53
Show Gist options
  • Select an option

  • Save Hunter87ff/acc1ee92b52d846f23de694f763e7ef7 to your computer and use it in GitHub Desktop.

Select an option

Save Hunter87ff/acc1ee92b52d846f23de694f763e7ef7 to your computer and use it in GitHub Desktop.
py web server port forwarding using localhost.run
# 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