@21natzil/

flask-proxy

Python

Hello world in python flask

fork
loading
Files
  • main.py
  • requirements.txt

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.6738025859952343","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"ZnJvbSBmbGFzayBpbXBvcnQgRmxhc2sKZnJvbSByZXF1ZXN0cyBpbXBvcnQgZ2V0CgphcHAgPSBGbGFzayhfX25hbWVfXykKU0lURV9OQU1FID0gJ2h0dHBzOi8vcHl0aG9uZGlzY29yZC5jb20nCgpAYXBwLnJvdXRlKCcvJywgZGVmYXVsdHM9eydwYXRoJzogJyd9KQpAYXBwLnJvdXRlKCcvPHBhdGg6cGF0aD4nKQpkZWYgcHJveHkocGF0aCk6CiAgcmV0dXJuIGdldChmJ3tTSVRFX05BTUV9e3BhdGh9JykuY29udGVudAoKaWYgX19uYW1lX18gPT0gJ19fbWFpbl9fJzoKICBhcHAucnVuKGhvc3Q9JzAuMC4wLjAnLCBwb3J0PTgwODApCg=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from flask import Flask
from requests import get

app = Flask(__name__)
SITE_NAME = 'https://pythondiscord.com'

@app.route('/', defaults={'path': ''})
@app.route('/<path:path>')
def proxy(path):
  return get(f'{SITE_NAME}{path}').content

if __name__ == '__main__':
  app.run(host='0.0.0.0', port=8080)