server: bind single address if cluster address is 127.0.0.1 (python) (#1877)

A continuation of https://github.com/koush/scrypted/pull/1820 for the missing Python half.
This commit is contained in:
Brett Jia
2025-08-26 12:23:32 -04:00
committed by GitHub
parent 7a67c70ef7
commit eaabd02bfe

View File

@@ -247,7 +247,7 @@ async def cluster_listen_zero(
callback: Callable[[asyncio.StreamReader, asyncio.StreamWriter]]
) -> ClusterServerListener:
SCRYPTED_CLUSTER_ADDRESS = os.getenv("SCRYPTED_CLUSTER_ADDRESS")
if not SCRYPTED_CLUSTER_ADDRESS:
if not SCRYPTED_CLUSTER_ADDRESS or SCRYPTED_CLUSTER_ADDRESS == "127.0.0.1":
server = await asyncio.start_server(callback, host=None, port=0)
port = server.sockets[0].getsockname()[1]
return {