def __init__(self, port:int, auth_token:str, subdomain:str):
"""Build ngrok HTTP tunnel
Assume ngrok version 2.x. A temporary ngrok configuration file is created where the ngrok token is stored for running the command.
:param port: localhost port forwarded through tunnel
:param auth_token: Ngrok auth token to use
:param subdomain: Use this subdomain for the tunnelling
"""
assert find_executable("ngrok"), "ngrok command must be installed, see https://ngrok.com/"
self.port = port
self.auth_token = auth_token
self.subdomain = subdomain
self.ngrok = None
self.config_file_handle, self.config_file = tempfile.mkstemp()
评论列表
文章目录