diff options
author | Richard van der Hoff <github@rvanderhoff.org.uk> | 2017-12-18 22:34:50 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-18 22:34:50 +0000 |
commit | 48fa4e1e5b102cad4690786ec1f54b93aa90a6db (patch) | |
tree | c1c1097431e4398de9a02107f9a98075efd230df /synapse/app/user_dir.py | |
parent | Merge pull request #2717 from matrix-org/erikj/createroom_content (diff) | |
parent | Implement listen_tcp method in remaining workers (diff) | |
download | synapse-48fa4e1e5b102cad4690786ec1f54b93aa90a6db.tar.xz |
Merge pull request #2435 from silkeh/listen-ipv6-default
Adapt the default config to bind on both IPv4 and IPv6 on all platforms
Diffstat (limited to 'synapse/app/user_dir.py')
-rw-r--r-- | synapse/app/user_dir.py | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/synapse/app/user_dir.py b/synapse/app/user_dir.py index be661a70c7..a48c4a2ae6 100644 --- a/synapse/app/user_dir.py +++ b/synapse/app/user_dir.py @@ -131,17 +131,16 @@ class UserDirectoryServer(HomeServer): root_resource = create_resource_tree(resources, Resource()) - for address in bind_addresses: - reactor.listenTCP( - port, - SynapseSite( - "synapse.access.http.%s" % (site_tag,), - site_tag, - listener_config, - root_resource, - ), - interface=address + _base.listen_tcp( + bind_addresses, + port, + SynapseSite( + "synapse.access.http.%s" % (site_tag,), + site_tag, + listener_config, + root_resource, ) + ) logger.info("Synapse user_dir now listening on port %d", port) @@ -150,18 +149,15 @@ class UserDirectoryServer(HomeServer): if listener["type"] == "http": self._listen_http(listener) elif listener["type"] == "manhole": - bind_addresses = listener["bind_addresses"] - - for address in bind_addresses: - reactor.listenTCP( - listener["port"], - manhole( - username="matrix", - password="rabbithole", - globals={"hs": self}, - ), - interface=address + _base.listen_tcp( + listener["bind_addresses"], + listener["port"], + manhole( + username="matrix", + password="rabbithole", + globals={"hs": self}, ) + ) else: logger.warn("Unrecognized listener type: %s", listener["type"]) |