summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
Diffstat (limited to 'synapse')
-rwxr-xr-xsynapse/app/homeserver.py9
-rw-r--r--synapse/http/server.py7
2 files changed, 13 insertions, 3 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index aa7c722efc..15c454af76 100755
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -225,13 +225,18 @@ class SynapseHomeServer(HomeServer):
 
         if not config.no_tls and config.bind_port is not None:
             reactor.listenSSL(
-                config.bind_port, Site(self.root_resource), self.tls_context_factory
+                config.bind_port,
+                Site(self.root_resource),
+                self.tls_context_factory,
+                interface=config.bind_host
             )
             logger.info("Synapse now listening on port %d", config.bind_port)
 
         if config.unsecure_port is not None:
             reactor.listenTCP(
-                config.unsecure_port, Site(self.root_resource)
+                config.unsecure_port,
+                Site(self.root_resource),
+                interface=config.bind_host
             )
             logger.info("Synapse now listening on port %d", config.unsecure_port)
 
diff --git a/synapse/http/server.py b/synapse/http/server.py
index d77cb77799..f1376ee243 100644
--- a/synapse/http/server.py
+++ b/synapse/http/server.py
@@ -86,6 +86,7 @@ class JsonResource(HttpServer, resource.Resource):
         self.clock = hs.get_clock()
         self.path_regexs = {}
         self.version_string = hs.version_string
+        self.hs = hs
 
     def register_path(self, method, path_pattern, callback):
         self.path_regexs.setdefault(method, []).append(
@@ -99,7 +100,11 @@ class JsonResource(HttpServer, resource.Resource):
             port (int): The port to listen on.
 
         """
-        reactor.listenTCP(port, server.Site(self))
+        reactor.listenTCP(
+            port,
+            server.Site(self),
+            interface=self.hs.config.bind_host
+        )
 
     # Gets called by twisted
     def render(self, request):