aboutsummaryrefslogtreecommitdiff
path: root/modules/ngrok.py
diff options
context:
space:
mode:
author不会画画的中医不是好程序员 <yfszzx@gmail.com>2022-10-16 21:16:08 +0800
committerGitHub <noreply@github.com>2022-10-16 21:16:08 +0800
commit272d979d1c9763cbe1046770c7c4e1f669feab0f (patch)
tree90652d409002d639d6346c61d23aa368be22b050 /modules/ngrok.py
parent5d8c59eee505cf15ec6994d05bb941440d90e44e (diff)
parent36a0ba357ab0742c3c4a28437b68fb29a235afbe (diff)
Merge branch 'AUTOMATIC1111:master' into master
Diffstat (limited to 'modules/ngrok.py')
-rw-r--r--modules/ngrok.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/ngrok.py b/modules/ngrok.py
index 7d03a6df..5c5f349a 100644
--- a/modules/ngrok.py
+++ b/modules/ngrok.py
@@ -1,12 +1,14 @@
from pyngrok import ngrok, conf, exception
-def connect(token, port):
+def connect(token, port, region):
if token == None:
token = 'None'
- conf.get_default().auth_token = token
+ config = conf.PyngrokConfig(
+ auth_token=token, region=region
+ )
try:
- public_url = ngrok.connect(port).public_url
+ public_url = ngrok.connect(port, pyngrok_config=config).public_url
except exception.PyngrokNgrokError:
print(f'Invalid ngrok authtoken, ngrok connection aborted.\n'
f'Your token: {token}, get the right one on https://dashboard.ngrok.com/get-started/your-authtoken')