summary refs log tree commit diff
path: root/synapse/app
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-09-01 22:38:52 +0100
committerMark Haines <mark.haines@matrix.org>2014-09-01 22:38:52 +0100
commit399e0048840ff322091508c02d1877e259973806 (patch)
treeba7fb3f14d98e829586e56bbc133353f016dc883 /synapse/app
parentenable ECDHE ciphers (diff)
downloadsynapse-399e0048840ff322091508c02d1877e259973806.tar.xz
Add unsecure listener port to homeserver
Diffstat (limited to 'synapse/app')
-rwxr-xr-xsynapse/app/homeserver.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index cbbf600f2e..606c9c650d 100755
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -206,11 +206,17 @@ class SynapseHomeServer(HomeServer):
         """
         return "%s-%s" % (resource, path_seg)
 
-    def start_listening(self, port):
-        reactor.listenSSL(
-            port, Site(self.root_resource), self.tls_context_factory
-        )
-        logger.info("Synapse now listening on port %d", port)
+    def start_listening(self, secure_port, unsecure_port):
+        if secure_port is not None:
+            reactor.listenSSL(
+                secure_port, Site(self.root_resource), self.tls_context_factory
+            )
+            logger.info("Synapse now listening on port %d", secure_port)
+        if unsecure_port is not None:
+            reactor.listenTCP(
+                unsecure_port, Site(self.root_resource)
+            )
+            logger.info("Synapse now listening on port %d", unsecure_port)
 
 
 def run():
@@ -249,7 +255,7 @@ def setup():
         web_client=config.webclient,
         redirect_root_to_web_client=True,
     )
-    hs.start_listening(config.bind_port)
+    hs.start_listening(config.bind_port, config.unsecure_port)
 
     hs.get_db_pool()