Skip to content

Commit 1a01191

Browse files
authored
Add username and password in ngrok.
1 parent 2505f39 commit 1a01191

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

modules/ngrok.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from pyngrok import ngrok, conf, exception
22

33
def connect(token, port, region):
4+
account = None
45
if token == None:
56
token = 'None'
67
else:
@@ -13,10 +14,10 @@ def connect(token, port, region):
1314
auth_token=token, region=region
1415
)
1516
try:
16-
if account:
17-
public_url = ngrok.connect(port, pyngrok_config=config, auth=account).public_url
18-
else:
17+
if account == None:
1918
public_url = ngrok.connect(port, pyngrok_config=config).public_url
19+
else:
20+
public_url = ngrok.connect(port, pyngrok_config=config, auth=account).public_url
2021
except exception.PyngrokNgrokError:
2122
print(f'Invalid ngrok authtoken, ngrok connection aborted.\n'
2223
f'Your token: {token}, get the right one on https://dashboard.ngrok.com/get-started/your-authtoken')

0 commit comments

Comments
 (0)