1
0
Fork 0
forked from zovos/bot_tg
bot_tg/webapp/ngrok_tunnel.py
Omelechko Danil b47e6bee81 Update
2026-04-11 00:59:38 +03:00

18 lines
598 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""Скрипт для локального тестирования Mini App с ngrok"""
import time
from pyngrok import conf, ngrok
conf.get_default().auth_token = "39k4ojhN5UPUWQwb1ly84ORM2IE_5JnhMaKk5p8LFM3TCetyg"
tunnel = ngrok.connect(8080, "http")
print(f"\n{'='*50}")
print(f" NGROK URL: {tunnel.public_url}")
print(f"{'='*50}\n")
print("Туннель открыт. Не закрывай это окно!")
print("Ctrl+C чтобы остановить.\n")
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
ngrok.kill()
print("Туннель закрыт.")