Spaces:
Running
Running
File size: 578 Bytes
3c2a81d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
from flask import Flask, request, Response
app = Flask("DiscordRocks Instant Chat Proxy")
DISCORD_ROCKS_HOST = 'chat.discord.rocks'
CHAT_UI_HOST = 'cutycat2000x-instantchat.static.hf.space'
@app.route("/<path:path>", methods=['GET', 'POST'])
def handle_request(path):
chat_ui_url = f'https://{DISCORD_ROCKS_HOST}/{path}'
response = Response()
response.status_code = 200
response.content_type = "text/html"
response.data = requests.get(chat_ui_url).content
return response
if __name__ == "__main__":
app.run(debug=True, host="0.0.0.0", port=7860)
|