diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2022-10-15 07:47:26 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-15 07:47:26 +0000 |
commit | f42e0aae6de6b9a7f8da4eaf13594a13502b4fa9 (patch) | |
tree | 472025101577ff5cbd45a3bcb524e6e4accb75ec /modules/ngrok.py | |
parent | 0e77ee24b0b651d6a564245243850e4fb9831e31 (diff) | |
parent | d13ce89e203d76ab2b54a3406a93a5e4304f529e (diff) | |
download | stable-diffusion-webui-gfx803-f42e0aae6de6b9a7f8da4eaf13594a13502b4fa9.tar.gz stable-diffusion-webui-gfx803-f42e0aae6de6b9a7f8da4eaf13594a13502b4fa9.tar.bz2 stable-diffusion-webui-gfx803-f42e0aae6de6b9a7f8da4eaf13594a13502b4fa9.zip |
Merge branch 'master' into master
Diffstat (limited to 'modules/ngrok.py')
-rw-r--r-- | modules/ngrok.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/ngrok.py b/modules/ngrok.py new file mode 100644 index 00000000..7d03a6df --- /dev/null +++ b/modules/ngrok.py @@ -0,0 +1,15 @@ +from pyngrok import ngrok, conf, exception + + +def connect(token, port): + if token == None: + token = 'None' + conf.get_default().auth_token = token + try: + public_url = ngrok.connect(port).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') + else: + print(f'ngrok connected to localhost:{port}! URL: {public_url}\n' + 'You can use this link after the launch is complete.') |