mirror of
https://github.com/koush/scrypted.git
synced 2026-02-03 14:13:28 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user