Skip to content

Commit 8e8916b

Browse files
committed
Bug fix on kwargs passed to ngrok config
1 parent bafdbee commit 8e8916b

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

pystream/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ def start(**kwargs) -> None:
6161
if config.env.ngrok_token:
6262
try:
6363
import pyngrok # noqa: F401
64-
except ImportError:
64+
except ImportError as error:
6565
raise ImportError(
66-
"\n\tPlease install 'stream-localhost[ngrok]'"
66+
f"\n\n{error.name}\n\tpip install 'stream-localhost[ngrok]'"
6767
)
68-
Process(target=ngrok.run_tunnel, args=(logger,)).start()
68+
Process(target=ngrok.run_tunnel, args=(logger,), kwargs=kwargs).start()
6969
uvicorn.run(**argument_dict)

pystream/models/ngrok.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ def get_tunnel(logger: Logger) -> Union[HttpUrl, NoReturn]:
3131
logger.error(error)
3232

3333

34-
def run_tunnel(logger: Logger) -> None:
34+
def run_tunnel(logger: Logger, **kwargs) -> None:
3535
"""Runs reverse proxy on video port to expose it using a public URL.
3636
3737
Args:
3838
logger: Takes uvicorn custom logger as an argument.
3939
"""
40+
config.env = config.EnvConfig(**kwargs)
4041
if public_url := get_tunnel(logger=logger):
4142
logger.info(f"Already hosting {config.env.video_port} on {public_url}")
4243
return
@@ -56,7 +57,6 @@ def run_tunnel(logger: Logger) -> None:
5657
sock.listen(1)
5758
connection = None
5859

59-
print(public_url)
6060
logger.info(f'Tunneling http://{config.env.video_host}:{config.env.video_port} through public URL: {public_url}')
6161
try:
6262
connection, client_address = sock.accept()

0 commit comments

Comments
 (0)