openi_online / the_flask_ngrok.py
ACCA225's picture
Upload 14 files
9287a32 verified
raw
history blame
615 Bytes
from flask import Flask, redirect
import requests
import os
import random
from flask import Flask, redirect
import requests
import os
import subprocess
ngrok_token3 = "2cdw5pJsqgsq1igQKeHIpNwTNG7_7LQD3jojKKQ7PzcnNkok5"#'2YypH9d2VXVL78HxF7g0lintH17_2GbtkFNFFngUkTZcyQ4SD'
edge3 = "edghts_2czmwh4KcPnhK3tIzfL0Y1aHkha"
command_ngrok = f"ngrok tunnel --label edge={edge3} --authtoken={ngrok_token3} --region=ap http://localhost:5006"
def ngrok_flask():
try:
while True:
os.system(command_ngrok)
except KeyboardInterrupt:
print("ngrok启动失败")
ngrok_flask()
ngrok_flask()