Restore default bind address

This commit is contained in:
Erik Johnston 2017-01-10 17:21:41 +00:00
parent 8a0fddfd73
commit edd6cdfc9a
9 changed files with 29 additions and 84 deletions

View file

@ -76,8 +76,7 @@ class AppserviceServer(HomeServer):
def _listen_http(self, listener_config):
port = listener_config["port"]
bind_address = listener_config.get("bind_address", None)
bind_addresses = listener_config.get("bind_addresses", [])
bind_addresses = listener_config["bind_addresses"]
site_tag = listener_config.get("tag", port)
resources = {}
for res in listener_config["resources"]:
@ -87,9 +86,6 @@ class AppserviceServer(HomeServer):
root_resource = create_resource_tree(resources, Resource())
if bind_address is not None:
bind_addresses.append(bind_address)
for address in bind_addresses:
reactor.listenTCP(
port,
@ -109,11 +105,7 @@ class AppserviceServer(HomeServer):
if listener["type"] == "http":
self._listen_http(listener)
elif listener["type"] == "manhole":
bind_address = listener.get("bind_address", None)
bind_addresses = listener.get("bind_addresses", [])
if bind_address is not None:
bind_addresses.append(bind_address)
bind_addresses = listener["bind_addresses"]
for address in bind_addresses:
reactor.listenTCP(