connectors/__init__.py
branchwxPython4
changeset 3721 6365e33fb11f
parent 3501 fa291393aac7
child 3750 f62625418bff
--- a/connectors/__init__.py	Thu Feb 02 17:17:04 2023 +0100
+++ b/connectors/__init__.py	Thu Feb 02 17:48:51 2023 +0100
@@ -27,6 +27,7 @@
 
 
 from __future__ import absolute_import
+import os
 from os import listdir, path
 from connectors.ConnectorBase import ConnectorBase
 
@@ -60,6 +61,8 @@
                 schemes += [scheme]
 
 
+LocalHost = os.environ.get("BEREMIZ_LOCAL_HOST", "localhost")
+
 def ConnectorFactory(uri, confnodesroot):
     """
     Return a connector corresponding to the URI
@@ -77,7 +80,7 @@
         # started on demand, listening on random port
         scheme = "PYRO"
         runtime_port = confnodesroot.StartLocalRuntime()
-        uri = "PYROLOC://127.0.0.1:" + str(runtime_port)
+        uri = "PYROLOC://"+LocalHost+":" + str(runtime_port)
 
     # commented code to enable for MDNS:// support
     # elif _scheme == "MDNS":