handling reserved ip address to bind to all network interfaces #382

This commit is contained in:
Florian Bruggisser 2021-12-14 17:55:54 +01:00
parent 0abfe9c60d
commit 30f57eec26

View File

@ -431,7 +431,8 @@ def start_server(interface, server_name, server_port, auth=None, ssl=None):
port = get_first_available_port(
server_port, server_port + TRY_NUM_PORTS
)
path_to_local_server = "http://{}:{}/".format(server_name, port)
url_host_name = "localhost" if server_name == "0.0.0.0" else server_name
path_to_local_server = "http://{}:{}/".format(url_host_name, port)
if auth is not None:
if not callable(auth):
app.auth = {account[0]: account[1] for account in auth}