2023-05-07 09:27:54 +00:00
|
|
|
import os
|
2023-11-04 12:22:28 +00:00
|
|
|
import global_var
|
2023-05-07 09:27:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
def ngrok_connect():
|
|
|
|
from pyngrok import ngrok, conf
|
2023-05-17 03:39:00 +00:00
|
|
|
|
2023-11-04 12:22:28 +00:00
|
|
|
conf.set_default(
|
|
|
|
conf.PyngrokConfig(ngrok_path="./ngrok.exe" if os.name == "nt" else "./ngrok")
|
|
|
|
)
|
2023-05-07 09:27:54 +00:00
|
|
|
ngrok.set_auth_token(os.environ["ngrok_token"])
|
2023-11-04 12:22:28 +00:00
|
|
|
http_tunnel = ngrok.connect(global_var.get(global_var.Args).port)
|
|
|
|
print(f"ngrok url: {http_tunnel.public_url}")
|